Figure B.2A Jmp @A; Figure B.2B Movw A, Pc; Figure B.2C Mulu A - Fujitsu F2MC-8L MB89620 Series Hardware Manual

8-bit microcontroller
Table of Contents

Advertisement

B Instructions
B.2 Special Instructions
This section describes special instructions, other than addressing.
JMP @A
l
This instruction moves the address contained in the accumulator (A) to the program counter
(PC) and branches to the new address. This instruction can be used to perform an N option
branch by placing N branch destination addresses in a table and moving the desired address to
the accumulator.
Figure B.2a shows an outline of the instruction operation.
l
MOVW A, PC
This instruction stores the PC contents in the accumulator A. This performs the opposite
operation to "JMP @A". By executing this instruction in the main routine and calling a particular
subroutine, the subroutine can determine whether the contents of A match a predetermined
value. The subroutine can check whether program runaway has occurred by checking whether
or not execution has branched from an expected location.
Figure B.2b shows an outline of the instruction operation.
The content of A after executing this instruction is the address of the next instruction (not the
address containing the operation code of this instruction). Accordingly, the value "1234
in A in the example shown in Figure B.2b is the address of the next operation code after
"MOVW A, PC".
MULU A
l
This instruction performs an unsigned multiplication of AL (lower 8 bits of the accumulator) and
TL (lower 8 bits of the temporary accumulator) and stores the 16-bit result in A. The content of T
(temporary accumulator) does not change. The arithmetic operation does not use the pre-
execution contents of AH (upper 8 bits of the accumulator) and TH (upper 8 bits of the
temporary accumulator). Since the flags remain unchanged, use care when branching is
required based on the result of multiplication.
Figure B.2c shows an outline of the instruction operation.
MB89620 series
(Before execution)
1234
A
H
XXXX
Old PC
H

Figure B.2a JMP @A

(Before execution)
XXXX
H
A
1234
H
Old PC

Figure B.2b MOVW A, PC

(Before execution)
5678
A
H
1234
T
H

Figure B.2c MULU A

(After execution)
1234
A
H
1234
New PC
H
(After execution)
1234
H
A
1234
H
New PC
(After execution)
1860
A
H
1234
T
H
" stored
H
APPEND
277
APPENDIX

Advertisement

Table of Contents
loading

Table of Contents