Esempio n. 1
0
        public Program Assemble(Address addr, TextReader rdr)
        {
            addrBase = addr;
            lexer = new Lexer(rdr);

            asm = new X86Assembler(services, new MsdosPlatform(services, arch), addrBase, entryPoints);
            asm.Platform = Platform;

            // Assemblers are strongly line-oriented.

            while (lexer.PeekToken() != Token.EOFile)
            {
                try {
                    ProcessLine();
                }
                catch (Exception ex)
                {
                    Debug.Print("Error on line {0}: {1}", lexer.LineNumber, ex.Message);
                    throw;
                }
            }

            asm.ReportUnresolvedSymbols();
            addrStart = addrBase;
            return asm.GetImage();
        }
Esempio n. 2
0
 public OperandParser(Lexer lexer, SymbolTable symtab, Address addrBase, PrimitiveType defaultWordWidth, PrimitiveType defaultAddressWidth)
 {
     this.lexer = lexer;
     this.symtab = symtab;
     this.addrBase = addrBase;
     this.defaultWordWidth = defaultWordWidth;
     this.defaultAddressWidth = defaultAddressWidth;
     this.segOverride = RegisterStorage.None;
 }
Esempio n. 3
0
 internal OperandParser CreateOperandParser(Lexer lexer)
 {
     return new OperandParser(lexer, symtab, addrBase, SegmentDataWidth, SegmentAddressWidth);
 }
Esempio n. 4
0
        public Program Assemble(Address addr, TextReader rdr)
        {
            addrBase = addr;
            lexer = new Lexer(rdr);

            asm = new X86Assembler(arch, addrBase, entryPoints);
            asm.Platform = Platform;

            // Assemblers are strongly line-oriented.

            while (lexer.PeekToken() != Token.EOFile)
            {
                ProcessLine();
            }

            asm.ReportUnresolvedSymbols();
            addrStart = addrBase;
            return asm.GetImage();
        }