Fujitsu MB89950/950A Pager User Manual


 
277
APPENDIX B Overview of Instructions
CALLV #vct
This instruction is used to branch to a subroutine address stored in the vector table. The instruction saves
the return address (contents of PC) in the location at the address contained in SP (stack pointer), and uses
vector addressing to cause a branch to the address stored in the vector table. Because CALLV #vct is a 1-
byte instruction, the use of this instruction for frequently used subroutines can reduce the entire program
size.
Figure B.3-7 "Example of executing CALLV #3" shows a summary of the instruction.
Figure B.3-7 Example of executing CALLV #3
After the CALLV #vct instruction is executed, the contents of PC saved on the stack area are the address of
the operation code of the next instruction, rather than the address of the operation code of CALLV #vct.
Accordingly, Figure B.3-7 "Example of executing CALLV #3" shows that the value saved in the stack
(1232
H
and 1233
H
) is 5679
H
, which is the address of the operation code of the instruction that follows
CALLV #vct (return address).
1 2 3 4H
PC
SP
F E D C
H
PC
SP
(Before execution) (After execution)
1 2 3 2
H
5 6 7 8H
1 2 3 2H
1 2 3 3H
X XH
X XH
F EH
D CH
F F C 6H
F F C 7H
1 2 3 2H
1 2 3 3H
5 6H
7 9H
F EH
D CH
F F C 6H
F F C 7H
(-2)