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
  • That's why in the assembly code I posted earlier left the MCU with nothing modified at the time of the "jump". If you had a single variable of "bit" type that holds the boot/mission status you could do a bit test (which doesn't disturb the MCU state) and "jump" accordingly to boot or mission ISR's. With no MCU state disturbed using this technique, you can write the ISR's without worrying about what's been modified at entry.

    More ideas, which by now you've got plenty of.

    --Dan Henry

Reply
  • That's why in the assembly code I posted earlier left the MCU with nothing modified at the time of the "jump". If you had a single variable of "bit" type that holds the boot/mission status you could do a bit test (which doesn't disturb the MCU state) and "jump" accordingly to boot or mission ISR's. With no MCU state disturbed using this technique, you can write the ISR's without worrying about what's been modified at entry.

    More ideas, which by now you've got plenty of.

    --Dan Henry

Children