We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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; } }
//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+02H00B8 30E20A JNB ACC.2,?C0063 00BB E500 R MOV A,buttons+04H00BD D3 SETB C00BE 9464 SUBB A,#064H00C0 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)?
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
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.