IP2022 Users ManualInstruction Set Architecture
www.ubicom.com
195
Example:
page 0x0000;set page bits
calladdxy ;call subroutine addxy
nop;addxy results available here
...
addxy:;subroutine entry point
mov w,0x099;subroutine start
add w,0x00F
...
ret ;return from subroutine
The call instruction in this example calls a
subroutine called addxy. When the call
instruction is executed, the address of the
following instruction (the nop instruction) is
pushed onto the stack and the program jumps to
the addxy routine. When the ret instruction is
executed, the saved program address is popped
from the stack and restored to the program
counter, which causes the program to continue
with the instruction immediately following the
call instruction.