Download Print this page

ZiLOG Z80380 User Manual page 81

Advertisement

Z
ILOG
DIVUW [HL,]src
Operation:
HL(15-0)
HL(31-16) ← remainder
The contents of the the HL register (dividend) are divided by the source operand (divisor)
and the quotient is stored in the lower word of the HL register; the remainder is stored in the
upper word of the HL register. The contents of the source are unaffected. Both operands are
treated as unsigned, binary integers. There are three possible outcomes of the DIVUW
instruction, depending on the division and the resulting quotient:
Case 1: If the quotient is less than 65536, then the quotient is left in the HL register, the
Overflow and Sign flags are cleared to 0, and the Zero flag is set according to the value of
the quotient.
Case 2: If the divisor is zero, the HL register is unchanged, the Zero and Overflow flags are
set to 1, and the Sign flag is cleared to 0.
Case 3: If the quotient is greater than or equal to 65536, the HL register is unchanged, the
Overflow flag is set to 1, and the Sign and Zero flags are cleared to 0.
Flags:
S:
Cleared
Z:
Set if the quotient or divisor is zero; cleared otherwise
H:
Unaffected
V:
Set if the divisor is zero or if the computed quotient is greater than or equal to 65536;
cleared otherwise
N:
Unaffected
C:
Unaffected
Addressing
Mode
Syntax
R:
DIVUW [HL,]R
RX:
DIVUW [HL,]RX
IM:
DIVUW [HL,]nn
X:
DIVUW [HL,](XY+d)
Field Encodings: rr: 00 for BC, 01 for DE, 11 for HL
y: 0 for IX, 1 for IY
DC-8297-03
src = R, RX, IM, X
← HL / src
Instruction Format
11101101 11001011 101110rr
11101101 11001011 1011110y
11101101 11001011 10111111 -n(low)- -n(high)
11y11101 11001011 ——d— 10111010
DIVIDE UNSIGNED (WORD)
Execute
Time
20
20
20
22+r
Z380
U
'
M
SER
S
ANUAL
DIVUW
Note
I
5-47

Advertisement

loading
Need help?

Need help?

Do you have a question about the Z80380 and is the answer not in the manual?

Subscribe to Our Youtube Channel