Chapter 5. INSTRUCTION
(16) CAL a
Naming :
Subroutine Call on status 1
Status :
Conditional depending on the status
Format :
Operand :
Function :
Subroutine code address a(Addr)
When ST =1 , PC
SR1
a(Addr)
PC + 1,
SR1
PA
PB
PA
PSR1
PSR2
PSR1
PSR2
PSR3
PB
SR2
SR3
SR2
When ST = 0 PC
PC + 1
PS ST
1
Note : PC actually has pseudo-random count against the next
instruction.
<Comment>
• In a program, control is allowed to be transferred to a mutual
subroutine. Since a call instruction preserves the return
address, it is possible to call the subroutine from different
locations in a program, and the subroutine can return control
accurately to the address that is preserved by the use of the
call return instruction (RTN).
Such calling is always conditional depending on the status.
a. If the status is reset, call is not executed.
b. If the status is set, call is rightly executed.
The subroutine stack (SR) of three levels enables a subroutine
to be manipulated on three levels. Besides, a long call (to call
another page) can be executed on any level.
• For a long call, an LPBI instruction should be executed before
the CAL. When LPBI is omitted (and when PA=PB), a short
call (calling in the same page) is executed.
5-9