<< Previous | Next >>

SRA r     Shift Right Arithmetic     Rabbit 2000/3000/4000/5000 Instruction

Opcode
Instruction
Operation
---- SRA r r = {r[7],r[7,1]}; CF = r[0]
CB 2F SRA A A = {A[7],A[7,1]}; CF = A[0]
CB 28 SRA B B = {B[7],B[7,1]}; CF = B[0]
CB 29 SRA C C = {C[7],C[7,1]}; CF = C[0]
CB 2A SRA D D = {D[7],D[7,1]}; CF = D[0]
CB 2B SRA E E = {E[7],E[7,1]}; CF = E[0]
CB 2C SRA H H = {H[7],H[7,1]}; CF = H[0]
CB 2D SRA L L = {L[7],L[7,1]}; CF = L[0]

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 2000/3000/4000
4
n/a
n/a
Rabbit 5000
4
4
2

Flags ALTD IOI/IOE
S
Z
L/V
C
F
R
SP
S
D
·
·
L
·
·
·

Description

Arithmetically shifts to the right the bits in r (any of the registers A, B, C, D, E, H, or L). Bits 7 through 1 are shifted to the next lowest-order bit position (bit 7 is shifted to bit 6, etc.). Bit 7 is also copied to itself. Bit 0 is shifted to the C flag. See the figure below.

Figure 22: The bit logic of the SRA instruction.


Rabbit Instructions << Previous | Next >> rabbit.com