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

Compiler problem while adding global variables

Hi everybody,

i have detected some absurd behavior in my project.
In not determinated intervalls i have a repeating problem with my At89c51Re2 software.

Now i reduced the Problem to a minimum.

Anywhere in my code i add a simple global variable (like static UINT32 g_ParameterChecksum = 0;) and the following code triggered the impossible error.

static UINT8 g_DigitalByteValue = 0;

...

        g_DigitalByteValue = 0;
        if (g_DigitalByteValue != 0)
        {
                Debug_ErrorOutput("Compiler Error? @digout");
                Error_FatalError(ERROR_UNKOWN);
        }
...

when i removed the new variable it works well.

I am use code banking,funtion pointers, interupts and Uv3 (from command line).
Program Size: data=233.1 xdata=8183 const=112 code=91375
Maximum block depth: 8

i suggest that some addresses pointers are mixed up, but i does not know why.

Has somebody a hint or solution for this problem?

Thanks a lot,
David

Parents
  • the assembler code seems valid.

    A step by step simulation is not possible because there are too many external device, which were not emulated.

    g_DigitalByteValue . . . . . . . . . .  STATIC   XDATA  U_CHAR   0000H  1
    
    ...
                                               ; SOURCE LINE # 60
    0002 E4                CLR     A
    0003 900000      R     MOV     DPTR,#g_DigitalByteValue
    0006 F0                MOVX    @DPTR,A
                                               ; SOURCE LINE # 61
    0007 600B              JZ      ?C0002
                                               ; SOURCE LINE # 62
                                               ; SOURCE LINE # 63
    0009 7F09              MOV     R7,#09H
    000B FE                MOV     R6,A
    000C 120000      E     LCALL   _Debug_ErrorOutputNumber
                                               ; SOURCE LINE # 64
    000F E4                CLR     A
    0010 FF                MOV     R7,A
    0011 120000      E     LCALL   _Error_FatalError
                                               ; SOURCE LINE # 65
    0014         ?C0002:
                                               ; SOURCE LINE # 66
    

Reply
  • the assembler code seems valid.

    A step by step simulation is not possible because there are too many external device, which were not emulated.

    g_DigitalByteValue . . . . . . . . . .  STATIC   XDATA  U_CHAR   0000H  1
    
    ...
                                               ; SOURCE LINE # 60
    0002 E4                CLR     A
    0003 900000      R     MOV     DPTR,#g_DigitalByteValue
    0006 F0                MOVX    @DPTR,A
                                               ; SOURCE LINE # 61
    0007 600B              JZ      ?C0002
                                               ; SOURCE LINE # 62
                                               ; SOURCE LINE # 63
    0009 7F09              MOV     R7,#09H
    000B FE                MOV     R6,A
    000C 120000      E     LCALL   _Debug_ErrorOutputNumber
                                               ; SOURCE LINE # 64
    000F E4                CLR     A
    0010 FF                MOV     R7,A
    0011 120000      E     LCALL   _Error_FatalError
                                               ; SOURCE LINE # 65
    0014         ?C0002:
                                               ; SOURCE LINE # 66
    

Children
No data