n----------m n--m n-|7------->0|->|CY| | v^---------u v--u | | (IX+d) v--u
SRA
(IX+d)
b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | |
---|---|---|---|---|---|---|---|---|
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | $DD |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | $CB |
d | ||||||||
0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | $2E |
An arithmetic shift right 1 bit position is performed on the contents of the memory address specified by the sum of the contents of Index Register IX and the two's-complement displacement integer, d. The contents of bit 0 are copied to the Carry flag and the previous contents of bit 7 remain unchanged.
S | is set if result is negative, otherwise it is reset. |
Z | is set if result is 0, otherwise it is reset. |
H | is reset. |
P/V | is set if parity even, otherwise it is reset |
N | is reset. |
C | is data from bit 0. |
Index Register IX contains $1000 and the contents of memory location $1022 are:
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|
1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |
Upon the execution of
SRA (IX+$22)
memory location $1022 and the Carry flag now contain:
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | C | |
---|---|---|---|---|---|---|---|---|---|
1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |