UPI-41A/41AH/42/42AH USER’S MANUAL
RLC A
Rotate Left Through Carry
Opcode:
1 1 1 1
0 1 1 1
The contents of the accumulator are rotated left one bit. Bit 7 replaces the carry bit; the carry
bit is rotated into the bit 0 position.
(A
n
a
1
)
w
(A
n
)
n
e
0 – 6
(A
0
)
w
(C)
(C)
w
(A7)
Example:
Assume accumulator contains a ‘signed’ number; isolate sign without changing value.
RLTC: CLR C
;CLEAR CARRY TO ZERO
RLC A
;ROTATE ACC LEFT, SIGN
;BIT (7) IS PLACED IN CARRY
RR A
;ROTATE ACC RIGHTÐVALUE
;(BITS 0 – 6) IS RESTORED,
;CARRY UNCHANGED, BIT 7
;IS ZERO
RR A
Rotate Right Without Carry
Opcode:
0 1 1 1
0 1 1 1
The contents of the accumulator are rotated right one bit. Bit 0 is rotated into the bit 7
position.
(A)
w
(A
n
a
1
)
n
e
0 – 6
(A
7
)
w
(A
0
)
Example
Assume accumulator contains 10110001.
RRNC: RRA
;NEW ACC CONTENTS ARE 11011000
RRC A
Rotate Right Through Carry
Opcode:
0 1 1 0
0 1 1 1
The contents of the accumulator are rotated one bit. Bit 0 replaces the carry bit; the carry bit is
rotated into the bit 7 position.
(A
n
)
w
(A
n
a
1)
n
e
0 – 6
(A
7
)
w
(C)
(C)
w
(A
0
)
Example
Assume carry is not set and accumulator contains 10110001.
RRTC: RRCA
;CARRY IS SET AND ACC
;CONTAINS 01011000
48