XRA R:
- This instruction logically EX-OR 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) and AC (Auxiliary Carry flag) are reset.
- It is a one byte instruction.
- Register addressing mode is used.
Example:
If A = 1010 1011 = ABH and D = 0001 0010 = 12H
If A = 1010 1011 = ABH and D = 0001 0010 = 12H
XRA D ; This instruction will logically EX-OR the contents of A (ABH) with the contents of D (12H) and the result (B9H) is stored in A.
XRA M:
- This instruction logically EX-OR 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) and AC (Auxiliary Carry flag) are reset.
- It is a one byte instruction.
- Register indirect addressing mode is used.
Example:
If HL = 2000H, (2000H) = 0100 0110 = 46H and A = 0011 0000 = 30H
If HL = 2000H, (2000H) = 0100 0110 = 46H and A = 0011 0000 = 30H
XRA M ; This instruction will logically EX-OR the contents of A (30H) with the contents of location 2000H i.e. 46H and the result (76H) is stored in A.
XRI 8-bit data:
- This instruction logically EX-OR 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) and AC (Auxiliary Carry flag) are reset.
- It is a two byte instruction.
- Immediate addressing mode is used.
Example:
If A = 1010 1100 = ACH
Comments
Post a Comment