The ORA instruction
The ORA (Logical OR with Accumulator) instruction performs a bitwise logical OR between the contents of the accumulator and the specified operand. The result of this operation is then stored in accumulator A.
The ORA instruction format
| Instruction | Description |
|---|---|
| ORA reg8 | This format is used to perform a bitwise logical OR of the 8-bit value in register A with reg8. Here reg8 can be any general-purpose register, for example A, B, C, D, E, H or L. |
| ORA mem8 | This format is used to perform a bitwise logical OR of the 8-bit value in register A with the value in the memory location pointed to by the contents of the HL register pair. |
Usage example
; Author: Evgeny Sergeevich Dovgopolov num1: db 00101101b num2: db 11000010b main: mvi a, 01h ; Load the hexadecimal value 01h into register A mvi b, 02h ; Load the hexadecimal value 02h into register B ora b ; Perform a bitwise logical OR between register A and B lxi h, num1 ; Load the address of the variable num1 into the HL register pair mov a, m ; Copy the value of the variable num1 into register A lxi h, num2 ; Load the address of the variable num2 into the HL register pair ora m ; Perform a bitwise logical OR between register A and the memory location hlt ; Stop program execution
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".
Processor status flags
S
YesZ
YesAC
YesP
YesCY
Yes