The JNC instruction
The JNC instruction is used to transfer program control to the specified memory address if C=0 in the flag register. In other words, it allows the program to choose a different execution path based on the result of a previous arithmetic or logical operation.
The JNC instruction format
| Instruction | Description |
|---|---|
| JNC addr16 | Performs a jump to an address or label if the CY flag is 0. |
Usage example
; Author: Evgeny Sergeevich Dovgopolov main: mvi a, 0FFh ; Load the hexadecimal value FFh into register A adi 01h ; Add 01h to the value in register A jnc NoCarry ; If C=0, jump to the label NoCarry mvi b, 01h ; Load the hexadecimal value 01h into register B hlt ; Stop program execution NoCarry: mvi c, 01h ; Copy the hexadecimal value 01h into register C hlt ; Stop program execution
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".
Processor status flags
S
NoZ
NoAC
NoP
NoCY
No