The JPE instruction
The JPE instruction is used to transfer program control to the specified memory address if P=1 (an even number of bits set to 1) 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 JPE instruction format
| Instruction | Description |
|---|---|
| JPE addr16 | Performs a jump to an address or label if the P flag is 1. |
Usage example
; Author: Evgeny Sergeevich Dovgopolov main: mvi a, 01h ; Load the hexadecimal value 01h into register A adi 02h ; Add 02h to the value in register A jpe Even ; If P=1, jump to the label Even sui 02h ; Subtract the value 02h from register A hlt ; Stop program execution Even: adi 03h ; Add 03h to the value in register A hlt ; Stop program execution
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".
Processor status flags
S
NoZ
NoAC
NoP
NoCY
No