The JPO instruction

The JPO instruction is used to transfer program control to the specified memory address if P=0 (an odd 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 JPO instruction format

InstructionDescription
JPO addr16 Performs a jump to an address or label if the P flag is 0.

Usage example

; Author: Evgeny Sergeevich Dovgopolov

main:
    mvi     a, 01h  ; Load the hexadecimal value 01h into register A
    adi     01h     ; Add 01h to the value in register A
    jpo     Odd     ; If P=0, jump to the label Odd

    sui     02h     ; Subtract the value 02h from register A
    hlt             ; Stop program execution

Odd:
    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
No
Z
No
AC
No
P
No
CY
No