MB95630H Series
MN702-00009-2v0-E
FUJITSU SEMICONDUCTOR LIMITED
619
APPENDIX A Instruction Overview
A.2 Special Instruction
Figure A.2-6 shows an assembler language example.
Figure A.2-6 Example of Using "XCHW A, PC"
●
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 A.2-7 shows a summary of the instruction.
Figure A.2-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 A.2-7 shows that the value saved in the
stack (0x1232 and 0x1233) is 0x5679, which is the address of the operation code of the
instruction that follows "CALLV vct" (return address).
MOVW
XCHW
DB
MOVW
A, #PUTSUB
A, PC
'PUT OUT DATA', EOL
A, 1234H
(Main routine)
XCHW A, EP
PUSHW A
MOV A, @EP
INCW EP
MOV IO, A
CMP A, #EOL
BNE PTS1
POPW A
XCHW A, EP
JMP @A
PUTSUB
PTS1
(Subroutine)
Output table
data here
0x1234
PC
SP
0xFEDC
PC
SP
(Before executing)
(After executing)
0x1232
0x5678
0x1232
0x1233
0xXX
0xXX
0xFE
0xDC
0xFFC6
0xFFC7
0x1232
0x1233
0x56
0x79
0xFE
0xDC
0xFFC6
0xFFC7
(
−
2)
Summary of Contents for 8FX
Page 2: ......
Page 4: ......
Page 8: ...iv ...
Page 18: ...xiv ...
Page 22: ...xviii ...
Page 650: ......