I have a little test program I've been playing with to test different 
variable sizes and locations.  I came across a weird situation and I'm 
hoping someone can help me explain it.

Chip=Cypress Ez-Usb (fx2lp) (8051/2)
Here is the guts of my test:

xdata BYTE buf[100];
xdata WORD count=0;
bit light=0;

void main() {


 while (1) {
  ++count;
  if (count % 1000 == 0) {
    bit=!bit;
    if (bit) { <snipped> } // custom board light on/off .. really simple 
memory reads
  }
 }
}

compiled with sdcc 2.8.0:
sdcc -mmcs51 --xram-loc 0x4000 .... args

The situation is this:

For some sizes of buf, the program works.  For other sizes, it doesn't 
work at all.

Here is the RAM line from a non-working .mem file after compilation 
(xdata BYTE buf[100]):

   EXTERNAL RAM     0x4000   0x4065     102    65536  

The funny thing is, I can increase it to large sizes, and it will work 
(xdata BYTE buf[0x3000]):

   EXTERNAL RAM     0x4000   0x7001   12290    65536  

Anyone have any idea why the program doesn't run when buf size is 100.  
I'm not even using the buf variable.. I was just playing with different 
ways of allocating data and where they are located and came across this 
problem. 

-Dennis


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to