Beispiel #1
0
 public GcMachine()
 {
     userStack        = new Varible[stackSize];
     systemStack      = new int[stackSize];
     userStackTop     = 0;
     systemStackTop   = 0;
     userStackBase    = 0;
     code             = new Instruction[codeSize];
     globalMap        = new Dictionary <string, Varible>();
     stringMap        = new List <string>();
     locals           = new Dictionary <string, List <string> >();
     wantPause        = false;
     flags            = MachineFlags.MACHINE_FLAGS_NONE;
     breakpointList   = new Dictionary <int, bool>();
     functionTable    = new SortedDictionary <int, string>();
     inSystemFunction = null;
     lineCode         = new int[maxLines];
     executeEvent     = new System.Threading.EventWaitHandle(false, System.Threading.EventResetMode.ManualReset);
     for (int i = 0; i < maxLines; ++i)
     {
         lineCode[i] = -1;
     }
     status          = MachineStatus.MACHINE_STATUS_PAUSED;
     compileComplete = false;
 }
Beispiel #2
0
        public void Reset()
        {
            _current = 0;
            _flags   = MachineFlags.Clear;

            AX  = null;
            BX  = null;
            DX  = null;
            BBX = false;

            Stack.Clear();
        }
Beispiel #3
0
 public void StepOver()
 {
     stepOutStackFrame = systemStackTop;
     if (pc == 0)
     {
         flags = MachineFlags.MACHINE_FLAGS_STEP_IN;
     }
     else
     {
         flags = MachineFlags.MACHINE_FLAGS_STEP_OVER;
     }
     _execute();
 }
Beispiel #4
0
 public Machine()
 {
     userStack      = new Varible[stackSize];
     systemStack    = new int[stackSize];
     userStackTop   = 0;
     systemStackTop = 0;
     userStackBase  = 0;
     code           = new Instruction[codeSize];
     globalMap      = new Dictionary <string, Varible>();
     stringMap      = new List <string>();
     locals         = new Dictionary <string, List <string> >();
     wantPause      = false;
     flags          = MachineFlags.MACHINE_FLAGS_NONE;
     breakpointList = new Dictionary <int, bool>();
     functionTable  = new SortedDictionary <int, string>();
     lineCode       = new int[maxLines];
     for (int i = 0; i < maxLines; ++i)
     {
         lineCode[i] = -1;
     }
     status          = MachineStatus.MACHINE_STATUS_PAUSED;
     compileComplete = false;
 }
Beispiel #5
0
 public void Execute()
 {
     flags = MachineFlags.MACHINE_FLAGS_NONE;
     _execute();
 }
Beispiel #6
0
 public void StepOut()
 {
     stepOutStackFrame = systemStackTop;
     flags             = MachineFlags.MACHINE_FLAGS_STEP_OUT;
     _execute();
 }
Beispiel #7
0
 public void ClearFlag(MachineFlags flag)
 {
     _flags ^= flag;
 }
Beispiel #8
0
 public void SetFlag(MachineFlags flag)
 {
     _flags |= flag;
 }
Beispiel #9
0
 public bool Test(MachineFlags flag)
 {
     return((_flags & flag) == flag);
 }