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

How to use LJMP with variable address?

I have a 16-bit address in the A register. I need to make a long jump
to this address, however it seems there is no way to do this with
assembly code. By looking at some assembly produced by Keil, when
they want to do this type of jump then end up doing:

LJMP    ?C?ICALL
Which registers do I load up with my address so that the jump to ?C?ICALL succeeds?

Parents
  • Ted,

    You may be posting only sections of the code, so what I'm not seeing may well be present, but...

    Are you saving the interrupted states of PSW, ACC, R6, R7, DPTR, and whatever registers missionCodeIsRunning() also modifies? Do both uart0_isr() and the destination ISR jumped to through DPTR know to how to restore these same registers?

    --Dan Henry

Reply
  • Ted,

    You may be posting only sections of the code, so what I'm not seeing may well be present, but...

    Are you saving the interrupted states of PSW, ACC, R6, R7, DPTR, and whatever registers missionCodeIsRunning() also modifies? Do both uart0_isr() and the destination ISR jumped to through DPTR know to how to restore these same registers?

    --Dan Henry

Children