SRA (HL)

Operation

  n----------m  n--m
n-|7------->0|->|CY|
| v^---------u  v--u
|  |  (HL)
v--u

Mnemonic

SRA

Operands

(HL)

b7b6b5b4b3b2b1b0
1 1 0 0 1 0 1 1$CB
0 0 1 0 1 1 1 0$2E

Description

An arithmetic shift right 1 bit position is performed on the contents of the memory address specified by the contents of the register pair HL. The contents of bit 0 are copied to the Carry flag and the previous contents of bit 7 remain unchanged.

Condition Bits Affected

Sis set if result is negative, otherwise it is reset.
Zis set if result is 0, otherwise it is reset.
His reset.
P/Vis set if parity even, otherwise it is reset
Nis reset.
Cis data from bit 0.

Example

The HL register pair contains $2828 and the contents of memory location $2828 are:

76543210
10111000

Upon the execution of

	SRA	(HL)

memory location $2828 and the Carry flag now contain:

76543210C
110111000