MOD

From Final Fantasy Hacktics Wiki
(Redirected from Event Instruction B8)
Jump to navigation Jump to search

{B8} MOD

MOD(xVARI,xVALU)

Divide Immediate (modulus) | Variable = Variable % ImmediateValue (high 32bit)


Divides the selected Variable Value by the Immediate Value and gives the remainder as the result.

So if the Variable Value was 0018 and the Immediate Value was 0006, the result would be 0000.

If the Variable Value was 0019 and the Immediate Value was 0006, the result would be 0001.


Can be used after Random to essentially generate a random number along a specific range - from 0 to one number less than the Immediate Value.


See also: {B4} MULT{B5} MULTVar{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.