import Memory from './Memory' ; export interface StackOptions { size : number ; end : number ; } export default class Stack extends Memory { private end : number ; constructor ( { end , size } ) { super ( { size } ) ; this . end = end ; } protected resolveIndex ( address ) { return this . end - 1 - address ; } protected resolveAddress ( index ) { return this . end - 1 + index ; } }