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.