393
APPENDIX B Instructions
r MULU A
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 contents 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.3-3 "MULU A" shows an outline of the instruction operation.
Figure B.3-3 MULU A
r DIVU A
This instruction divides the 16 bits of T by the 8 bits of AL, treating the data as unsigned. The
instruction stores the result in AL and the remainder in TL, both as 8 bit data. AH and TH are
both set to "zero". The arithmetic operation does not use the value of AH prior to instruction
execution. The result is not assured for data that produces a result that exceeds 8 bits. As
there is no indication that the result exceeded 8 bits, check the data before performing. Since
the flags remain unchanged, use care when branching is required based on the result of the
division.
Figure B.3-4 "DIVU A" shows an outline of the instruction operation.
Figure B.3-4 DIVU A
r XCHW A,PC
This instruction exchanges the contents of A and PC, and as a result branches to the address
corresponding to contents of A before execution. The contents of A after execution assume the
address next to the address where the operation code of the "XCHW A,PC" is stored. The
instruction can be used to specify a table in the main routine which is used in a subroutine.
Figure B.3-5 "XCHW A,PC" shows an outline of the instruction operation.
Figure B.3-5 XCHW A,PC
(Before execution)
(After execution)
A
5 6 7 8H
T
1 2 3 4H
A1 8 6 H
T
1 2 3 4H
0
(Before execution)
(After execution)
A5 6 7 8H
T
1 8 6 2H
A0 0 3 4H
T
0 0 0 2H
(Before execution)
(After execution)
A5 6 7 8H
PC
1 2 3 4H
A1 2 3 5H
PC
5 6 7 8H