popStack() {
    if (this.sp === 0) {
      throw new Error('Stack empty');
    }

    this.setSP(this.sp - 2);

    const offset = this.STACK_OFFSET + this.sp;
    const address = this.memory.getUint16(offset);
    this.memory.setUint16(offset, 0);
    this.emit('memory', offset, 2);

    return address;
  }
/**
   * Pops the instruction address from stack.
   *
   * @return {number} instruction address.
   */
Pops the instruction address from stack.
@return {number} instruction address.
Pops the instruction address from stack . @return { number } instruction address .
popStack() {
    if (this.sp === 0) {
      throw new Error('Stack empty');
    }
    this.setSP(this.sp - 2);
    const offset = this.STACK_OFFSET + this.sp;
    const address = this.memory.getUint16(offset);
    this.memory.setUint16(offset, 0);
    this.emit('memory', offset, 2);
    return address;
  }
popStack ( ) { if ( this . sp === 0 ) { throw new Error ( 'Stack empty' ) ; } this . setSP ( this . sp - 2 ) ; const offset = this . STACK_OFFSET + this . sp ; const address = this . memory . getUint16 ( offset ) ; this . memory . setUint16 ( offset , 0 ) ; this . emit ( 'memory' , offset , 2 ) ; return address ; }
Pops the instruction address from stack.
Pops the instruction address from stack .