English
Language : 

GMS36 Datasheet, PDF (54/109 Pages) Hynix Semiconductor – 4-BIT SINGLE CHIP MICROCOMPUTERS
Chapter 5. INSTRUCTION
(16) CAL a
Naming :
Status :
Format :
Operand :
Function :
<Comment>
Subroutine Call on status 1
ìConditional depending on the status
Subroutine code address a(Addr)
When ST =1 , PC à a(Addr)
SR1 à PC + 1,
SR2 à SR1
SR3 à SR2
When ST = 0 PC à PC + 1
PA à PB
PSR1 à PA
PSR2 à PSR1
PSR3 à PSR2
PB à PS ST à 1
Note : PC actually has pseudo-random count against the next
instruction.
• 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