mod method

void mod()

Implementation

void mod() {
  //Debugger.verbose('${pcHex(-1)} [mod]');

  final operands = mem.loadb(programCounter- 1) < 193
      ? visitOperandsLongForm()
      : visitOperandsVar(2, false);

  final resultTo = readb();

  assert(operands[1].peekValue != 0);

  final x = MathHelper.toSigned(operands[0].value!);
  final y = MathHelper.toSigned(operands[1].value!);

  final result = doMod(x, y);

  //Debugger.verbose('    >>> (mod ${pc.toRadixString(16)}) ${operands[0].value}(${toSigned(operands[0].value)}) % ${operands[1].value}(${toSigned(operands[1].value)}) = $result');

  writeVariable(resultTo, result);
}