7、比较运算指令

7.1、比较指令

指令的语法

举例

周期数

CMP reg,reg

cmp dl,cl

1

CMP mem,reg

cmp array[si],bl

2

CMP reg,mem

cmp bh,array[si]

2

CMP reg,immed

cmp bx,24

1

CMP mem,immed

cmp tester,4000

2

CMP accum,immed

cmp ax,1000

1

7.2、比较交换指令

CMPXCHG mem,reg

cmpxchg string,bl

6

CMPXCHG reg,reg

cmpxchg bx,cx

6

CMPXCHG8B reg,mem64

cmpxchg8b ax,[bx]

10

8、循环指令

8.1、循环指令

LOOP label

loop wend

5, 6

LOOPE label

loope again

7, 8

LOOPZ label

loopz again

7, 8

LOOPNE label

loopne for_next

7, 8

LOOPNZ label

loopnz for_next

7, 8

8.2、循环指令

JCXZ label

jcxz notfound

6,5

JECXZ label

jecxz notfound

6,5