Skip to main content

OR

Compute the bitwise OR of the two operands, storing the result in the left operand.

OpcodeBytesCyclesFormExample
$7C33OR B:_, {U_BYTE}OR B:1, 123
$D043OR P:_, {U_PAIR}OR P:2, 12345
$7D33OR I:_, {U_BYTE}OR I:4, 123
$D143OR I:_, {U_PAIR}OR I:4, 12345
$7E33OR I:_, XHEX {XINT}OR I:4, XHEX $D000_0000
$7F33OR B:_, B:_OR B:1, B:2
$8033OR P:_, P:_OR P:2, P:4
$8133OR I:_, I:_OR I:4, I:8
Condition flagOutput
zero (ZF)If the result is zero, this flag is 1; otherwise it is 0.
negative (NF)This flag is updated with the highest bit of the result.
For example, if OR B:0, $03 stores $80 in B:0, then NF will be 1.
overflow (OF)This flag is always 0.
carry (CF)This flag is always 0.

Notes

  • OR is commonly used for bitmask operations.

  • Large literal values such as $D000_0000 must be compatible with XHEX encoding.