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

Newbie dumb question

Why, when I use the Simulator on this code, does A return as 0 when it should be 3?

MAIN:
        NOP
        MOV     DPTR, #CommandTable
        MOVX    A, @DPTR                ; Get the offset
        MOV     DPTR, #Subroutines
        JMP     @A+DPTR

CommandTable:
        DB Low(GetStatus - Subroutines)

Subroutines:
SetStatus:
        NOP
        NOP
        RET
GetStatus:
        NOP
        NOP
        RET

END

Thanks for your help.

Steve

Parents
  • "The question is in direct relation to this comment earlier in this thread"

    Ah yes - so it is!

    So the real questions is what laarus rag meant by it?

    The context does suggest that he's thinking of CODE and XDATA both mapped to the same physical memory addresses...

    Having never done that, I don't know if it's possible or, if it is, how to do it.
    I guess the MAP Debug command would be the place to start...

Reply
  • "The question is in direct relation to this comment earlier in this thread"

    Ah yes - so it is!

    So the real questions is what laarus rag meant by it?

    The context does suggest that he's thinking of CODE and XDATA both mapped to the same physical memory addresses...

    Having never done that, I don't know if it's possible or, if it is, how to do it.
    I guess the MAP Debug command would be the place to start...

Children