MOD
Revision as of 05:01, 23 February 2021 by Xifanie (talk | contribs) (Xifanie moved page Event Instruction B8 to MOD)
{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.