public CPU(Module module, Context context) { this.context = context; this.scope = ""; this.moduleName = module.moduleName; position = new Position(module.moduleName, null); SS = new StackSegment <VAL>(Constant.MAX_STACK); for (int i = 0; i < SS.Size; i++) { SS[i] = new VAL(); } ES = new StackSegment <VAL>(Constant.MAX_EXTRA); for (int i = 0; i < ES.Size; i++) { ES[i] = new VAL(); } EX = new StackSegment <int>(Constant.MAX_EXCEPTION); REG = new Register(SS); IP = module.IP1; BP = 0; SI = 0; CS = module.CS; }
StackSegment <VAL> SS; //Stack segment public Register(StackSegment <VAL> SS) { this.SS = SS; REGS = new VAL[Constant.MAX_CPU_REG_NUM]; CPU_SP = -1; // register pointer }