This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Global Variable Initialization

Hello,

I have variables initialized at the global level in my .c file but they are never being initialized. When I watch in d-scope and INIT.a51 is executing:

?C_START:
MOV DPTR,#?C_INITSEG
LOOP:
WATCHDOG
CLR A
MOV R6,#1
MOVC A,@A+DPTR
JZ INITEND <------Here!!!!!!!!!!
INC DPTR
MOV R7,A
ANL A,#3FH
JNB ACC.5,NOBIG

the code jumps right to INITEND because the MOVC instruction puts zero into the accumulator, even though I've initalized global variables with values. Anyone see the problem?

Thanks,

Bob

0