callVN method

void callVN()

Implementation

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

  var operands = visitOperandsVar(4, true);

  //
  // var resultStore = Engine.STACK_MARKER;
  var returnAddr = programCounter;

  assert(operands.isNotEmpty);

  if (operands[0].value == 0) {
    log.fine("call_vn got a zero address but is skipping store");

    //writeVariable(resultStore, Engine.FALSE);
  } else {
    //unpack function address
    operands[0].rawValue = unpack(operands[0].value!);

    //move to the routine address
    programCounter = operands[0].rawValue!;

    operands.removeRange(0, 1);

    //setup the routine stack frame and locals
    visitRoutine(operands.map<int?>((o) => o.value).toList());

    // "Lick call but throws away the result"
    callStack.push(Engine.stackMarker);

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