Samsung 8-Bit CMOS Microcontroller, S3C9228/P9228 user manual RL Rotate Left

Models: S3C9228/P9228 8-Bit CMOS Microcontroller

1 462
Download 462 pages 42.12 Kb
Page 355
Image 355

S3C9228/P9228

SAM88RCRI INSTRUCTION SET

 

 

RL — Rotate Left

RL

dst

Operation:

C ¨ dst (7)

dst (0) ¨ dst (7)

dst (n + 1) ¨ dst (n), n = 0–6

The contents of the destination operand are rotated left one bit position. The initial value of bit 7 is moved to the bit zero (LSB) position and also replaces the carry flag.

7

0

C

 

Flags:

C: Set if the bit rotated from the most significant bit position (bit 7) was "1".

Z:Set if the result is "0"; cleared otherwise.

S:Set if the result bit 7 is set; cleared otherwise.

V:Set if arithmetic overflow occurred, that is, if the sign of the destination changed during

rotation; cleared otherwise.

D:Unaffected.

H:Unaffected.

Format:

Bytes Cycles Opcode

Addr Mode

(Hex)

dst

opc

dst

2

4

90

R

4 91IR

Examples: Given: Register 00H = 0AAH, register 01H = 02H and register 02H = 17H:

RL

00H

Register 00H

= 55H, C = "1"

RL

@01H

Register 01H

= 02H, register 02H = 2EH, C = "0"

In the first example, if general register 00H contains the value 0AAH (10101010B), the statement "RL 00H" rotates the 0AAH value left one bit position, leaving the new value 55H (01010101B) and setting the carry and overflow flags.

6-39

Page 355
Image 355
Samsung 8-Bit CMOS Microcontroller, S3C9228/P9228 user manual RL Rotate Left