incChk method

void incChk()

Implementation

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

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

  //   final value = toSigned(readVariable(operands[0].rawValue)) + 1;
  // final varValue = readVariable(operands[0].rawValue);

  final value = MathHelper.toSigned(readVariable(operands[0].rawValue!)) + 1;

  //(ref http://www.gnelson.demon.co.uk/zspec/sect14.html notes #5)
  writeVariable(operands[0].rawValue!, value);

  branch(value > MathHelper.toSigned(operands[1].value!));
}