<< Previous | Next >>

SRA bb,BCDE
SRA bb,JKHL
    Shift Right Arithmetic
    Rabbit 4000/5000 Instruction

Opcode
Instruction
Operation
---- SRA bb,BCDE   BCDE = {B[7],BCDE[31,1]}
  CF = E[0]
  bb = bb - 1
repeat while bb != 0
DD 98 SRA 1,BCDE repeat the operation 1 time
DD 99 SRA 2,BCDE repeat the operation 2 times
DD 9B SRA 4,BCDE repeat the operation 4 times
---- SRA bb,JKHL   JKHL = {J[7],JKHL[31,1]}
  CF = L[0]
  bb = bb - 1
repeat while bb != 0
FD 98 SRA 1,JKHL repeat the operation 1 time
FD 99 SRA 2,JKHL repeat the operation 2 times
FD 9B SRA 4,JKHL repeat the operation 4 times

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 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 of the data in register BCDE or JKHL. Bits 1 through 31 are each shifted to the next lowest-order bit position. The highest-order bit of BCDE or JKHL is shifted into itself and the lowest-order bit is shifted to the C flag. See the figure below.

Figure 21: The bit logic of the SRA instruction.

The instruction repeats the number of times specified by bb, which can be 1, 2 or 4.


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