# Instruction type ANI d8 in 8085 Microprocessor

Microprocessor8085

In 8085 Instruction set, ANI is a mnemonic, which stands for “ANd Immediate with Accumulator” and “d8” stands for any 8-bit or 1-Bytedata. This instruction is used to AND 8-bit immediate data with the Accumulator’s content. The result of this ANDingoperation will be stored in the Accumulator itself over writing its previous content. As it is an arithmetic operation do S, P, and Z flags are affected based on the result. Cy is reset to 0, and AC is set to 1. It occupies 2-Bytes in the memory.

Mnemonics, Operand Opcode(in HEX) Bytes
ANI Data E6 2

Let us consider ANI CDH as a sample instruction of this type. It is a 2-Byte instruction. We are considering the initial content of Accumulator is ABH. So after this ANI operation result will be stored back on to the Accumulator itself. The result of execution of this instruction has been depicted in the following tracing table −

Before After

(A)

ABH 89H

(F)

Any values Cy=0,AC=1,S=1,P=0,Z=0

The internal calculation has been done as follows −

(A) ABH ---> 1010 1011
(d8) CDH ---> 1100 1101
---------
ANI CDH ---> 1000 1001 (89H)


2002 E6 ANI CD A = A and CDH
2003 CD Operand CDH

The timing diagram against this instruction ANI CDH execution is as follows.

Summary − So this instruction ANA E requires 2-Bytes, 2 Machine Cycles (Opcode Fetch, Memory Read) and 7 T-States for execution as shown in the timing diagram.

Published on 04-Dec-2018 12:01:05