Esempio n. 1
0
        private Int16 ConvertACmd(string item)
        {
            if (Parser.IsVariable(item))
            {
                if (!Symbols.Contains(item.Substring(1)))
                {
                    Symbols.AddEntry(item.Substring(1), variableBaseAddress);
                    variableBaseAddress++;
                }

                return(Convert.ToInt16(Symbols.GetAddress(item.Substring(1))));
            }

            string address = item.Substring(1);

            return(Convert.ToInt16(address));
        }
Esempio n. 2
0
        private void FirstPass(string inputFile)
        {
            int address = 0;

            foreach (var line in File.ReadLines(@inputFile))
            {
                if (IsEmptyLine(line) || IsCommentLine(line))
                {
                    continue;
                }

                if (IsSymbolDeclaration(line))
                {
                    Symbols.AddEntry(GetSymbol(line), address);
                    continue;
                }

                address++;
            }
        }