Instruction Set ArchitectureIP2022 Users Manual
120
www.ubicom.com
CALL addr13
Call Subroutine
Operation:
top-of-stack = PC15:0 + 1
PC12:0 = addr13
PC15:13 = PA2:PA0
Bits affected:
None
Opcode:
110k kkkk kkkk kkkk
Description:
This instruction calls a subroutine. The full 16-bit
address of the next program instruction is saved
on the stack and the program counter is loaded
with a new address, which causes a jump to that
program address.
Bits 12:0 come from the 13-bit constant value in
the instruction, and bits 15:13 come from the
PA2:PA0 bits in the STATUS register.
The subroutine is terminated by a ret
instruction, which restores the saved address to
the program counter. Execution proceeds from
the instruction following the call instruction.
Cycles:
3