Instruction Set
4-208
ROR
ROR
Flag Settings After Instruction
If
count=0, flags are unaffected. Otherwise, flags are affected as shown below:
Examples
This example determines the number of bits which are set in the AX register.
Tips
Use ROR to change the order of the bits within a component.
Related Instructions
If you want to
See
Rotate the bits of a component and the value of CF to the left
RCL
Rotate the bits of a component and the value of CF to the right
RCR
Rotate the bits of a component to the left
ROL
Multiply an integer by a power of 2
SAL/SHL
Divide an integer by a power of 2
SAR
Shift the bits of the operand downward
SHR
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
Undefined unless single-bit rotation, then:
OF=1 if result larger than destination operand
OF=0 otherwise
?
–
–
–
–
– res – res – res
CF=value of top bit copied into it
MOV
CX,16
MOV
BX,0
; BX contains the number of bits
; which are set in AX
LOOP_START:
ROR
AX,1
JC
INC_COUNT
; if carry flag is set, increment the count
LOOP
LOOP_START
JMP
DONE
INC_COUNT:
INC
BX
; increment the count
LOOP
LOOP_START
DONE:
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...