From: Dennis M. <djm...@gm...> - 2008-10-20 22:57:55
|
When I invoke sdcc with a global static variable in my firmware like this: xdata unsigned char buf[10]; It works and I can use the buffer. When I change the buffer to instead have allocated data like this: xdata unsigned char buf[] = { 0xXX, 0xYY, 0xZZ etc }; The firmware doesn't run. Here is what I'm changing in my c code: xdata BYTE serial_iic[5]; is changed to: xdata BYTE serial_iic[] = { 0xc2, 0xb4, 0x04, 0x82, 0x00 }; Here is a diff between a working and non_working example asm files output by sdcc. --- eeprom.asm 2008-10-20 16:44:36.000000000 -0600 +++ eeprom.asm_broken 2008-10-20 16:25:09.000000000 -0600 @@ -777,8 +777,6 @@ _D4OFF = 0xa000 _D5ON = 0xb800 _D5OFF = 0xb000 -_serial_iic:: - .ds 5 ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- @@ -787,6 +785,8 @@ ; external initialized ram data ;-------------------------------------------------------- .area XISEG (XDATA) +_serial_iic:: + .ds 5 .area HOME (CODE) .area GSINIT0 (CODE) .area GSINIT1 (CODE) @@ -1096,4 +1096,10 @@ .db 0x0A .db 0x00 .area XINIT (CODE) +__xinit__serial_iic: + .db #0xC2 + .db #0xB4 + .db #0x04 + .db #0x82 + .db #0x00 .area CABS (ABS,CODE) It seems to me that the addition of the __xinit_serial_iic label causes things to break. Any thoughts? Thanks Dennis |