Rrd rotate right digit – Zilog Z80380 User Manual
Page 191

5-157
Z380
™
U
SER
'
S
M
ANUAL
Z
ILOG
DC-8297-03
RRD
ROTATE RIGHT DIGIT
RRD
Operation:
tmp(3-0)
←
A(3-0)
A(3-0)
←
dst(3-0)
dst(3-0)
←
dst(7-4)
dst(7-4)
←
tmp(3-0)
The low digit of the accumulator is logically concatenated to the destination byte whose
memory address is in the HL register. The resulting three-digit quantity is rotated to the right
by one BCD digit (four bits). The upper digit of the source is moved to the lower digit of the
source; the lower digit of the source is moved to the lower digit of the accumulator, and the
lower digit of the accumulator is moved to the upper digit of the source. The upper digit of
the accumulator is unaffected. In multiple-digit BCD arithmetic, this instruction can be used
to shift to the right a string of BCD digits, thus dividing it by a power of ten. The accumulator
serves to transfer digits between successive bytes of the string. This is analogous to the use
of the Carry flag in multiple-precision shifting using the RR instruction.
Flags:
S:
Set if the accumulator is negative after the operation; cleared otherwise
Z:
Set if the accumulator is zero after the operation; cleared otherwise
H:
Cleared
P:
Set if the parity of the accumulator is even after the operation; cleared otherwise
N:
Cleared
C:
Unaffected
Addressing
Execute
Mode
Syntax
Instruction Format
Time
Note
RRD
11101101 01100111
3+r