CPU flags are NOT set. JNZ uses the (Z) flag.
The (Z) flag is set if a calculation gives a zero result.
Assembler
|
Machine Code
|
Explanation
|
JNZ Forward
|
C2 12
|
Jump if the (Z) flag is NOT set.
If the (Z) flag is NOT set, jump forward 12 places.
If the (Z) flag is NOT set, add 12 to (IP).
If the (Z) flag is set, add 2 to (IP).
The assembler calculates the jump distance.
The biggest possible forward jump is +127.
|
JNZ Back
|
C2 FE
|
Jump if the (Z) flag is NOT set.
If the (Z) flag is NOT set, jump back 2 places.
If the (Z) flag is NOT set, add -2 to (IP).
If the (Z) flag is set, add 2 to (IP).
The assembler calculates the jump distance.
The biggest possible backward jump is -128.
FE is -2. This is explained here.
|
Pop-up Help
Share with your friends: |