UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
170
SRA
Shift Right Arithmetic
SRA dst
Operation
Description
This instruction performs an arithmetic shift to the right by one bit position on the destina-
tion operand. Bit 0 replaces the Carry (C) flag. The value of Bit 7 (the Sign bit) does not
change, but its value shifts into Bit 6.
Flags
Attributes
Escaped Mode Addressing
Using Escaped Mode Addressing, address modes R or IR can specify a Working Register.
If the destination address is prefixed by
EH
(1110B), a Working Register is inferred. For
example, if Working Register R12 (
CH
) is the desired destination operand, use
ECH
as the
destination operand in the opcode. To access Registers with addresses
E0H
to
EFH
, either
set the Working Group Pointer, RP[7:4], to
EH
or use indirect addressing.
C
Set if the bit rotated from the least-significant bit position was 1 (that is, Bit 0 was 1).
Z
Set if the result is zero; reset otherwise.
S
Set if Bit 7 of the result is set; reset otherwise.
V
Reset to 0.
D
Unaffected.
H
Unaffected.
Mnemonic
Destination
Opcode (Hex)
Operand 1
Operand 2
Operand 3
SRA
R1
D0
R1
—
—
SRA
@R1
D1
R1
—
—
D7 D6 D5 D4 D3 D2 D1 D0
dst
C