Exemplo n.º 1
0
  // Pushes the given value at the top of the stack and increments sp by 1.
  private void pushValue(int stackID, short value) throws ProgramException {
    short sp = getSP();

    if (stackID == MAIN_STACK) stackSegment.setValueAt(sp, value, false);
    else workingStackSegment.setValueAt(sp, value, false);

    checkSP((short) (sp + 1));
    setSP((short) (sp + 1));
  }