Fujitsu F2MC-8L F202RA Hardware Manual page 405

F2mc-8l 8-bit microcontroller
Hide thumbs Also See for F2MC-8L F202RA:
Table of Contents

Advertisement

● XCHW A, PC
This instruction replaces the contents of A and the contents of PC, resulting in a branch to the address
indicated by the contents of A before execution. The contents of A after execution become the value of the
address next to the address holding the operation code, XCHW A, PC. This instruction is useful especially
when a table is specified in the main routine and a subroutine uses it.
Figure B.2-5 shows an overview.
(Before execution)
A
PC
After execution of this instruction, the contents of A do not become the address holding the operation code
of this instruction. Instead, they are the same as the address holding the next instruction. In Figure B.2-5 ,
therefore, the value stored in A is 1235
XCHW A, PC. Note that it is not 1234
Figure B.2-6 shows an example of assembler coding.
(Main routine)
.
.
.
MOVW
A, #PUTSUB
XCHW
A, PC
DB
'PUT OUT DATA', EOL
MOVW
A, 1234H
.
.
.
Figure B.2-5 XCHW A, PC
5678
H
1234
H
, agreeing with the address holding the operation code next to
H
but 1235
H
Figure B.2-6 Usage Example of XCHW A, PC
(After execution)
1235
A
H
5678
PC
H
.
H
(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
Outputs a
table data
unit.
389

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-8l mb89202Mb89202/f202ra series

Table of Contents