OR

From Final Fantasy Hacktics Wiki
Revision as of 05:02, 23 February 2021 by Xifanie (talk | contribs) (Xifanie moved page Event Instruction BC to OR)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{BC} OR

OR(xVARI,xVALU)

OR bitwise operand | Variable = Variable OR ImmediateValue

This command compares the individual bits of the value between a Variable and a specific ImmediateValue, and produces a single binary output.

With OR, the resulting bit outputs are set to 1 (TRUE) if either value's bit input is 1. This makes this a good way to enable a specific bit within a byte without changing the rest of the bits.

The bits available within a single byte are:

  • 0x80
  • 0x40
  • 0x20
  • 0x10
  • 0x08
  • 0x04
  • 0x02
  • 0x01

So, for example, if you want to edit a unit's Battle Stats to add the Control flag (which is bit 0x08), but leave the other flags such as their Team untouched, you would LoadAddress the byte into an editable variable, then OR that variable against a value of 0008: OR(xVARI,x0008). This uses a zero value on every bit except 08, which uses a one value, forcing the output to always have Control flagged, while leaving the rest of the bits from the variable unaltered.


See also: {BD} ORVar{BE} ZERO


Variable : Half-Word (hex)

Click here for the list of Variables


Immediate Value : Half-Word (hex)

Value that will be use along with the operand to change the address' value.