Esempio n. 1
0
        public static void Run()
        {
            long prognum;
            long linenum;

            while (true)
            {
                // get current program and line
                prognum = Mem.GetByte(MemPos.prog);
                linenum = Mem.GetNum(MemPos.progline, 2);
                // do debug events as needed
                Debug.RaiseProgLine(prognum, linenum);
                if (Debug.HasBreakpoint(prognum, linenum))
                {
                    Debug.RaiseBreakpoint(prognum, linenum);
                }
                // handle current line
                _lineText   = ILCode.GetLine(prognum, linenum);
                _tokens     = _lineText.Split('\t');
                _tokenCount = _tokens.GetUpperBound(0) + 1;
                _tokenNum   = 0;
                if (Functions.IsNumber(_tokens[_tokenNum]))
                {
                    _tokenNum++; // line number
                }
                try
                {
                    // move to next line in preparation, could be changed by command
                    Mem.SetNum(MemPos.progline, 2, linenum + 1);
                    ExecuteLine();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    throw;
                }
            }
        }
Esempio n. 2
0
 public static void RaiseProgLine(long prognum, long linenum)
 {
     Console.WriteLine($"{prognum.ToString("000")}:{linenum.ToString("0000")} {ILCode.GetLine(prognum, linenum)}");
 }