SRA Rotate bits right with Carry

Rotate bits right with carry, bit 7 remains unchanged
Visualisation of the SRA instruction

An arithmetic shift right 1 bit position is performed on the contents of operand. The contents of bit 0 are copied to the Carry flag and the previous contents of bit 7 remain unchanged.

76543210
 
SRA r
11001011CB
00101r
 
SRA (HL)
11001011CB
001011102E
 
SRA (IX+d)
11011101DD
11001011CB
d
001011102E
 
SRA (IY+d)
11111101FD
11001011CB
d
001011102E
Registers
Registerr
B000
C001
D010
E011
H100
L101
A111
Flags Affected
Flags
sz-h-p/v-c
sset if result negative
zset if result is 0
hreset
p/vset if parity even, reset if parity odd
cdata from bit 0 of source register
Opcode Matrix
ABCDEHL(HL)(IX+d)(IY+d)
SRA
SRA A
CB2F28
SRA B
CB2828
SRA C
CB2928
SRA D
CB2A28
SRA E
CB2B28
SRA H
CB2C28
SRA L
CB2D28
SRA (HL)
CB2E215
SRA (IX+d)
DDCBnn2E423
SRA (IY+d)
FDCBnn2E423
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register Memory

Last modified November 16, 2021: Add flags to rot operations (2eee171)