ANA R:
- This instruction logically AND the contents of the specified register with the contents of the accumulator.
- Register R can be any 8-bit general purpose register like A, B, C, D, E, H and L.
- The result is stored in the accumulator.
- S (Sign flag), Z (Zero flag), P (Parity flag) are modified.
- CY (Carry flag) is reset and AC (Auxiliary Carry flag) is set.
- It is a one byte instruction.
- Register addressing mode is used.
Example:
If A = 0101 1001 = 59H and B = 0000 0011 = 03H
If A = 0101 1001 = 59H and B = 0000 0011 = 03H
ANA B ; This instruction will logically AND the contents of A (59H) with the contents of B (03H) and the result (01H) is stored in A.
ANA M:
- This instruction logically AND the contents of the memory location pointed by HL register pair with the contents of the accumulator.
- The result is stored in the accumulator.
- S (Sign flag), Z (Zero flag), P (Parity flag) are modified.
- CY (Carry flag) is reset and AC (Auxiliary Carry flag) is set.
- It is a one byte instruction.
- Register indirect addressing mode is used.
Example:
If A = 0101 0101 = 55H, HL = 2000H and (2000H) = 0011 0011 = 33H
ANA M ; This instruction will logically AND the contents of A (55H) with the contents of location 2000H i.e. 33H and the result (11H) is stored in A.
ANI 8-bit data:
- This instruction logically AND the 8-bit data given in the instruction itself with the contents of the accumulator.
- The result is stored in the accumulator.
- S (Sign flag), Z (Zero flag), P (Parity flag) are modified.
- CY (Carry flag) is reset and AC (Auxiliary Carry flag) is set.
- It is a two byte instruction.
- Immediate addressing mode is used.
Example:
If A = 0100 0101 = 45H
If A = 0100 0101 = 45H
Comments
Post a Comment