518
APPENDIX B Overview of Instructions
B.3
Special Instructions
This section describes the special instructions used for other than addressing.
I
Special instructions
H
JMP @A
This instruction sets the contents of A (accumulator) to PC (program counter) as the address,
and causes a branch to that address. One of the N branch destination addresses is selected
from a table, and then transferred to A. The instruction can be executed to perform N-branch
processing.
Figure B.3-1 "JMP @A" shows a summary of the instruction.
Figure B.3-1 JMP @A
H
MOVW A, PC
This instruction performs the operation which is the reverse of that performed by JMP @A. That
is, the instruction stores the contents of PC in A. When the instruction is executed in the main
routine, so that a specific subroutine is called, whether A contains a predetermined value can be
checked by the subroutine. This can be used to determine that the branch source is not any
unexpected section of the program and to check for program runaway.
Figure B.3-2 "MOVW A, PC" shows a summary of the instruction.
Figure B.3-2 MOVW A, PC
After the MOVW A, PC instruction is executed, A contains the address of the operation code of
the next instruction, rather than the address of the operation code of MOVW A, PC.
Accordingly, Figure B.3-2 "MOVW A, PC" shows that A contains 1234
H
, which is the address of
the operation code of the instruction that follows MOVW A, PC.
H
MULU A
This instruction performs an unsigned multiplication of AL (lower eight bits of the accumulator)
and TL (lower eight bits of the temporary accumulator), and stores the 16-bit result in A. The
contents of T (temporary accumulator) do not change. The contents of AH (higher eight bits of
the accumulator) and TH (higher eight bits of the temporary accumulator) before execution of
the instruction are not used for the operation. The instruction does not change the flags, and
1 2 3 4
H
A
X X X X
H
Previous PC
A
Current PC
(Before execution)
(After execution)
1 2 3 4
H
1 2 3 4
H
A
A
X X X X
H
1 2 3 4
H
1 2 3 4
H
1 2 3 4
H
Previous PC
Current PC