From: Maarten B. <sou...@ds...> - 2005-02-17 08:00:41
|
Hi Jason, What you're missing is the fact that these globals are there to tell the linker to include the corresponding libraries. The actual genXINIT is in crtxinit.asm/.rel. You haven't by accident turned off the internal XRAM? > I'm using the most recent SDCC snapshot [2.4.8 #961 (Feb 16 2005) > (MINGW32)] to compile for an Atmel T89C51RD2 and I seem to be having > issues with global variable initialization. When trying to do > something like: > > const xdata unsigned char EXAMPLE[64] = {0x00, 0x01, ... , 0x62, 0x63}; > > I can see the initialized values in my .asm file under the XINIT > .area. However when running the program, the data accessed by > EXAMPLE[i] gives unexpected results and not my initialized data. > > When inspecting my .asm file I see where the global is declared > (_mcs51_genXINIT) that's supposed to handle initialization, but no > code is ever defined to actually copy the XINIT data to XISEG (see > below). > > I'm relatively new to embedded programming, especially compiling with > SDCC. Am I missing something, or isn't there supposed to be assembly > code generated for _mcs51_genXINIT (and other startup globals like > _mcs51_genXRAMCLEAR)??? > > Thanks. > > ******** > ;-------------------------------------------------------- > ; global & static initialisations > ;-------------------------------------------------------- > .area CSEG (CODE) > .area GSINIT (CODE) > .area GSFINAL (CODE) > .area GSINIT (CODE) > .globl __sdcc_gsinit_startup > .globl __sdcc_program_startup > .globl __start__stack > .globl __mcs51_genXINIT > .globl __mcs51_genXRAMCLEAR > .globl __mcs51_genRAMCLEAR > .area GSFINAL (CODE) > ljmp __sdcc_program_startup > ******** > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-user > > |