Fujitsu 8FX Hardware Manual page 641

8-bit microcontroller new 8fx family
Table of Contents

Advertisement

MB95630H Series
Figure A.2-6 shows an assembler language example.
(Main routine)
MOVW
A, #PUTSUB
XCHW
A, PC
DB
'PUT OUT DATA', EOL
MOVW
A, 1234H
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.
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).
MN702-00009-2v0-E
Figure A.2-6 Example of Using "XCHW A, PC"
Figure A.2-7 Example of Executing CALLV #3
(Before executing)
PC
0x5678
SP
0x1234
( 2)
0x1232
0xXX
0x1233
0xXX
0xFFC6
0xFE
0xFFC7
0xDC
FUJITSU SEMICONDUCTOR LIMITED
APPENDIX A Instruction Overview
(Subroutine)
PUTSUB
PUSHW A
PTS1
MOV A, @EP
INCW EP
MOV IO, A
CMP A, #EOL
BNE PTS1
POPW A
XCHW A, EP
JMP @A
(After executing)
PC
0xFEDC
SP
0x1232
0x1232
0x56
0x1233
0x79
0xFFC6
0xFE
0xFFC7
0xDC
A.2 Special Instruction
Output table
data here
619

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb95630h series

Table of Contents