In x86 assembly code, are JE and JNE exactly the same as JZ and JNZ?
In x86 assembly code, are JE and JNE exactly the same as JZ and
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JEandJZare just different names for exactly the same thing: aconditional jump when
ZF(the “zero” flag) is equal to 1.(Similarly,
JNEandJNZare just different names for a conditional jumpwhen
ZFis equal to 0.)You could use them interchangeably, but you should use them depending on
what you are doing:
JZ/JNZare more appropriate when you are explicitly testingfor something being equal to zero:
JEandJNEare more appropriate after aCMPinstruction:(A
CMPinstruction performs a subtraction, and throws the value of the result away, while keeping the flags; which is why you getZF=1when the operands are equaland
ZF=0when they’re not.)