81
Instruction Formats and Number of Execution States
Instruction code
Addressing
mode
Mnem.
Operands
1st byte
2nd byte
3rd byte 4th byte
No. of
states
Register direct
DIVXU
Rs, Rd
5
1
rs
0
rd
14
Note: DIVXU Overflow
Since the DIVXU instruction performs 16-bit
÷
8-bit
→
8-bit division, an overflow will occur if
the divisor byte is equal to or less than the upper byte of the dividend. For example, H'FFFF
÷
H'01
→
H'FFFF causes an overflow. (The quotient has more than 8 bits.)
Overflows can be avoided by using a subprogram like the following. A work register is required.
To perform
DIVXU R0L, R1:
MOV.B #H'00, R2H
CMP.B R0L, R1H
BCC L1
DIVXU R0L, R1
(*1)
MOV.B R1L, R2L
BRA L2
L1 MOV.B R1H, R2L
(*2)
DIVXU R0L, R2
MOV.B R2H, R1H
(*3)
DIVXU R0L, R1
MOV.B R2L, R2H
MOV.B R1L, R2L
L2 RTS (*4)
Summary of Contents for H8/300L Series
Page 1: ...H8 300L Series Programming Manual ...
Page 6: ...iv ...
Page 8: ...2 ...
Page 11: ......
Page 14: ......
Page 46: ......
Page 48: ......
Page 60: ......
Page 83: ......
Page 116: ......
Page 150: ...144 ...
Page 151: ......
Page 156: ...150 ...