call_2n method

void call_2n()

Implementation

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

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

  var resultStore = Engine.stackMarker;

  var returnAddr = programCounter;

  // var addr = unpack(operands[0].value);

  //move to the routine address
  programCounter = unpack(operands[0].value!);

  //setup the routine stack frame and locals
  visitRoutine([operands[1].value]);

  //push the result store address onto the call stack
  callStack.push(resultStore);

  //push the return address onto the call stack
  callStack.push(returnAddr);
}