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

C51 not shows direct address in listing

Hi,

I use C51 version 9.60a (v9.60.0.0) for Nuvoton N76E003 chip programming.

Example of code:

            //All fields are uint8_t type
            if ((buttons.Hold & BUTTON_SET)) {
                if ((buttons.Duration > (uint8_t)(2 * BUTTON_HOLD_TICK))) {
                    config.displayOff ^= 0x01;
                }
            }

generates listing:

00B6 E500        R     MOV     A,buttons+02H
00B8 30E20A            JNB     ACC.2,?C0063
                                          
00BB E500        R     MOV     A,buttons+04H
00BD D3                SETB    C
00BE 9464              SUBB    A,#064H
00C0 4003              JC      ?C0063
                                          
00C2 630001      R     XRL     config+06H,#01H
                                          
The question: why all direct adresses shown as 00 value (in MOV / XRL operations of this example)?

Thanks.

  • Because that's a compiler listing. The compiler has no idea where those variables will eventually be placed.  That's for the linker to decide.

    Which is what that lone ´R´ is about: it marks a relocation yet to be resolved.

    If (for whatever reason) you actually need a listing with the actual addresses, look up the "absolute listing" option in the linker manual.