Professional Documents
Culture Documents
Assembly Language Program - Part V: 1. Conditional Instructions
Assembly Language Program - Part V: 1. Conditional Instructions
1. Conditional Instructions
1) CMP instruction
Objective: To compare 2 numeric data.
Function: Perform implied subtraction of a source from a destination.
Flag affected: AF, CF, OF, PF, SF, ZF.
Comparison for unsigned and signed operands.
2. Conditional Processing
5) E.g.:
MOV AX,5
CMP AX,5
JE L1
1
BACS1024 Introduction to Computer Systems
JNE L2
Mnemonic Description
JE Jump if equal
JNE Jump of not equal
JCXZ Jump if CX = 0
Mnemonic Description
JA Jump if above
JNBE Jump if not below or equal
JAE Jump if above or equal
JNB Jump if not below
JB Jump if below
JNAE Jump if not above or equal
JBE Jump if below or equal
JNA Jump is not above
Mnemonic Description
JG Jump if greater
JNLE Jump if not less or equal
JGE Jump if greater or equal
JNL Jump if not less than
JL Jump if less than
JNGE Jump if not greater or equal
JLE Jump if less than or equal
JNG Jump is not greater