RCL - Rotate Through Carry Left
Usage: RCL dest,count
Modifies Flags: CF OF
Rotates the bits in the destination to the left "count" times with all data pushed out the left side re-entering on the right. The Carry Flag holds the last bit rotated out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
RCR - Rotate Through Carry Right
Usage: RCR dest,count
Modifies Flags: CF OF
Rotates the bits in the destination to the right "count" times with all data pushed out the right side re-entering on the left. The Carry Flag holds the last bit rotated out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,1 | 2 | 9 | 3 | 2 |
mem,1 | 7 | 10 | 4 | 2-4 |
reg,CL | 5+n | 9 | 8-30 | 2 |
mem,CL | 8+n | 10 | 9-31 | 2-4 |
reg,immed8 | 5+n | 9 | 8-30 | 3 |
mem,immed8 | 8+n | 10 | 9-31 | 3-5 |
REP - Repeat String Operation
Usage: REP
Modifies Flags: None
Repeats execution of string instructions while CX != 0. After each string operation, CX is decremented and the Zero Flag is tested. The combination of a repeat prefix and a segment override on CPU's before the 386 may result in errors if an interrupt occurs before CX=0. The following code shows code that is susceptible to this and how to avoid it:
again: rep movs byte ptr ES:[DI],ES:[SI] ; vulnerable instr. jcxz next ; continue if REP successful loop again ; interrupt goofed count next:
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 2 | ? | 1 |
REPE/REPZ - Repeat Equal / Repeat Zero
Usage: REPE
REPZ
Modifies Flags: None
Repeats execution of string instructions while CX != 0 and the Zero Flag is set. CX is decremented and the Zero Flag tested after each string operation. The combination of a repeat prefix and a segment override on processors other than the 386 may result in errors if an interrupt occurs before CX=0. Look at example, how to avoid it.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 2 | ? | 1 |
REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero
Usage: REPNE
REPNZ
Modifies Flags: None
Repeats execution of string instructions while CX != 0 and the Zero Flag is clear. CX is decremented and the Zero Flag tested after each string operation. The combination of a repeat prefix and a segment override on processors other than the 386 may result in errors if an interrupt occurs before CX=0. There is an example how to avoid it.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 2 | ? | 1 |
RET/RETF - Return From Procedure
Usage: RET nBytes
RETF nBytes
RETN nBytes
Modifies Flags: None
Transfers control from a procedure back to the instruction address saved on the stack. "n bytes" is an optional number of bytes to release. Far returns pop the IP followed by the CS, while near returns pop only the IP register.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
retn | 11+m | 10+m | 5 | 1 |
retn immed | 11+m | 10+m | 5 | 3 |
retf | 15+m | 18+m | 13 | 1 |
retf (PM, same priv.) | 32+m | 18 | 1 | |
retf (PM, lesser priv.) | 68 | 33 | 1 | |
retf immed | 15+m | 18+m | 14 | 3 |
retf immed (PM, same priv.) | 32+m | 17 | 1 | |
retf immed (PM, lesser priv.) | 68 | 33 | 1 |
ROL - Rotate Left
Usage: ROL dest,count
Modifies Flags: CF OF
Rotates the bits in the destination to the left "count" times with all data pushed out the left side re-entering on the right. The Carry Flag will contain the value of the last bit rotated out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,1 | 2 | 3 | 3 | 2 |
mem,1 | 7 | 7 | 4 | 2-4 |
reg,CL | 5+n | 3 | 3 | 2 |
mem,CL | 8+n | 7 | 4 | 2-4 |
reg,immed8 | 5+n | 3 | 2 | 3 |
mem,immed8 | 8+n | 7 | 4 | 3-5 |
ROR - Rotate Right
Usage: ROR dest,count
Modifies Flags: CF OF
Rotates the bits in the destination to the right "count" times with all data pushed out the right side re-entering on the left. The Carry Flag will contain the value of the last bit rotated out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,1 | 2 | 3 | 3 | 2 |
mem,1 | 7 | 7 | 4 | 2-4 |
reg,CL | 5+n | 3 | 3 | 2 |
mem,CL | 8+n | 7 | 4 | 2-4 |
reg,immed8 | 5+n | 3 | 2 | 3 |
mem,immed8 | 8+n | 7 | 4 | 3-5 |
[ TOC | Previous | NeXt | Winston's page ]