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
"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...
The deductive powers of the professionals gives me that feeling of awe ;)
A.k.a. a von-Neumann memory architecture.
Having never done that, I don't know if it's possible or, if it is, how to do it.
It's easy with external memory (just combine the chip enable signals). For chips with internal flash and XRAM, this is a feature the chip designer would have to set up.
OTOH, there's really no point doing that for the OP's case. MOVC exists.
"It's easy with external memory"
Yes, but I meant I've never done it (nor tried to) in the simulator - which was the specific question.
in the simulator
That's even easier. In the menu find Debug->memory map, define the region as von-Neumann, done. For extra credit, find out how to do same in a debugger startup script (*.ini).
Thanks Mr Broeker, that's what I needed. And I appreciate all the helpful replies!