The ANI instruction

The ANI (Logical AND Immediate) instruction performs a bitwise logical AND of the contents of the accumulator with an 8-bit immediate value.

The ANI instruction format

InstructionDescription
ANI imm8 This format is used to perform a bitwise logical AND of imm8 with the 8-bit value in register A.

Usage example

; Author: Evgeny Sergeevich Dovgopolov

main:
    mvi     a, 0F1h  ; Load the hexadecimal value F1h into register A
    ani     01h      ; Perform a bitwise logical AND between register A and 1

    hlt              ; Stop program execution

Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".

Processor status flags

S
Yes
Z
Yes
AC
Yes
P
Yes
CY
Yes