n--m n---------m
|CY|<-|7<------0|<-- 0
v--u v---------u
r
SLA
r
| b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | $CB |
| 0 | 0 | 1 | 0 | 0 | r | |||
An arithmetic shift left 1 bit position is performed on the contents of register r. The contents of bit 7 are copied to the carry flag. Bit 0 is the least-significant bit. In the assembled object code, operand r is specified as follows:
| Register | r | Hex |
|---|---|---|
| A | 111 | $27 |
| B | 000 | $20 |
| C | 001 | $21 |
| D | 010 | $22 |
| E | 011 | $23 |
| H | 100 | $24 |
| L | 101 | $25 |
| 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 7. |
Register L contains the following data:
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 |
Upon the execution of
SLA L
register L and the Carry Flag now contain:
| C | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 |