1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Conditional Execution
In assembly breaks sequential program execution by altering the Instruction Pointer (IP).
Unconditional Jumps
Conditional Jumps
Control transfer happens via two primary mechanisms:
Unconditional Jumps
Control transfers directly to a label without checking flags or conditions.
Conditional Jumps
Control transfers to a label only if specific condition flags in the CPU status register are set or cleared.
The CMP (Compare) Instruction
Compares two operands by performing a non-destructive subtraction (destination - source). It updates CPU flags without modifying either operand.
CMP destination, sourceSyntax of CMP (Compare) Instruction
JMP (Unconditional Jump)
Forces immediate branching forward (to skip instructions) or backward (to create loops).
JMP labelSyntax of JMP (Unconditional Jump)
Conditional Jump Instructions (J<condition>)
Test specific CPU flags depending on whether the data is signed, unsigned, or checking explicit flags.
Signed Data Branching
Unsigned Data Branching
Special Flag Checks
Conditional Jump Instructions (J<condition>)
JE / JZJNE / JNZJG / JNLEJGE / JNLJL / JNGEJLE / JNG
Signed Data Branching
JA / JNBEJAE / JNB JB / JNAEJBE / JNA
Unsigned Data Branching
JC / JNC JO / JNO JS / JNS JXCZ
Special Flag Checks