指令 | 描述 | EFLAGS |
JA | 如果大于(above),则跳转 | CF=0与ZF=0 |
JAE | 如果大于(above)或等于,则跳转 | CF=0 |
JB | 如果小于(below),则跳转 | CF=1 |
JBE | 如果小于(below)或等于,则跳转 | CF=1或ZF=1 |
JC | 如果进位,则跳转 | CF=1 |
JCXZ | 如果CX寄存器为0,则跳转 | |
JECXZ | 如果ECX寄存器为0,则跳转 | |
JE | 如果相等,则跳转 | ZF=1 |
JG | 如果大于(greater),则跳转 | ZF=0或SF=OF |
JGE | 如果大于(greater)或等于,则跳转 | SF=OF |
JL | 如果小于(less),则跳转 | SF<>OF |
JLE | 如果小于(less)或等于,则跳转 | ZF=1或SF<>OF |
JNA | 如果不大于(above),则跳转 | CF=1或ZF=1 |
JNAE | 如果不大于(above)或等于,则跳转 | CF=1 |
JNB | 如果不小于(below),则跳转 | CF=0 |
JNBE | 如果不小于(below)或等于,则跳转 | CF=0或ZF=0 |
JNC | 如果无进位,则跳转 | CF=0 |
JNE | 如果不等于,则跳转 | ZF=0 |
JNG | 如果不大于(greater),则跳转 | ZF=1或SF<>OF |
JNGE | 如果不大于(greater)或等于 | SF<>OF |
JNL | 如果不小于(less),则跳转 | SF=OF |
JNLE | 如果不小于(less)或等于,则跳转 | ZF=0与SF=OF |
JNO | 如果不溢出,则跳转 | OF=0 |
JNP | 如果不奇偶校验,则跳转 | PF=0 |
JNS | 如果无符号,则跳转 | SF=0 |
JNZ | 如果非零,则跳转 | ZF=0 |
JO | 如果溢出,则跳转 | OF=1 |
JP | 如果奇偶校验,则跳转 | PF=1 |
JPE | 如果偶校验,则跳转 | PF=1 |
JPO | 如果计校验,则跳转 | PF=0 |
JS | 如果带符号,则跳转 | SF=1 |
JZ | 如果为零,则跳转 | ZF=1 |
cmp operand1, operand2
# cmptest.s - An example of using the CMP and JGE instructionS
.section .text
.global _start
_start:
nop
movl $10, %eax
movl $15, %ebx
cmp %eax, %ebx
jge greater
movl $1, %eax
int $0x80
greater:
movl $20, %ebx
movl $1, %eax
int $0x80
$ echo $?
20
movl $30, %eax
subl $30, %eax
jz overthere
movl $10, %edi
loop1:
< other code instructions >
dec %edi
jz out
jmp loop1
out:
.section .text
.global _start
_start:
nop
movl $1, %eax #move 1 to the EAX register
movb $0x7f, %bl #move the signed value 127 to the 8-bit BL register
addb $10, %bl #add 10 to the BL register
jo overthere
int $0x80
overthere:
movl $0, %ebx #move 0 to the EBX register
int $0x80
eflags 0xa92 [ AF SF IF OF ]
.section .text
.global _start
_start:
movl $1, %eax
movl $4, %ebx
subl $3, %ebx
jp overthere
int $0x80
overthere:
movl $100, %ebx
int $0x80
$ ./paritytest
$ echo $?
1
$ ./paritytest
$ echo $?
100
.section .text
.global _start
_start:
movl $1, %eax
movl $4, %ebx
subl $3, %ebx
jp overthere
int $0x80
overthere:
movl $100, %ebx
int $0x80
$ ./signtest
The value is: 2
The value is: 10
The value is: 80
The value is: 32
The value is: 50
The value is: 6
The value is: 11
The value is: 34
The value is: 15
The value is: 21
movl $0xffffffff, %ebx
inc %ebx
jc overflow
movl $0xffffffff, %ebx
addl $1, %ebx
jc overflow
movl $2, %eax
subl $4, %eax
jc overflow
指令 | 描述 |
CLC | 清空进位标志(设置它为零) |
CMC | 对进位标志求反(把它改变为相反的值) |
STC | 设置进位标志(设置它为1) |
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |