6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 11, 2024 7:11 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Oct 13, 2013 7:22 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 899
After creating a minimal target for CHOCHI, I got a simple LED flashing program working:
Code:
void delay(){
  int a;
  for(a=0x7FFF;a!=0;a--){
  };
}
void main(void)
{
        char* pLED;
        pLED = (char*)0xC000;
        while(1){
          delay();
          *pLED=1;
          delay();
          *pLED=0;
        }
}


Changing the 'int a' declaration to 'long a' breaks the code, without any error messages. I am assuming that some runtime code does not make it into the binary. Looking at the generated assembly I noticed a call to 'ldeax0sp', which seems like a likely culprit as the 'runtime' directory in the library source contains a number of such routines.

Do you think that's the problem? My current "CHOCHI1.lib" currently contains nothing but initialization code. Where does the runtime library come into the game? And shouldn't I be getting linker errors?

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: