Professional Documents
Culture Documents
Assembler
Compiler Vs Assembly
What is an assembler?
1. One-Pass Assembler
• These assemblers perform the whole conversion of assembly code to
machine code in one go.
• Symbol table and opcode tables are defined.
• keep the record of the location counter.
• Also, processes the pseudo instructions.
Types of assemblers
2. Multi-Pass/Two-Pass Assembler
• These assemblers first process the assembly code and store values in
the opcode table and symbol table. And then in the second step, they
generate the machine code using these tables.
• Finally, converts the opcode into the corresponding numeric opcode.
• Generates machine code according to values of literals and symbols.
Some Important Terms
• Opcode table: They store the value of mnemonics (The symbolic
representation of the opcode (machine level instruction) is
called mnemonics) and their corresponding numeric values.
• Symbol table: They store the value of programming language
symbols used by the programmer, and their corresponding numeric
values.
• Location Counter: It stores the address of the location where the
current instruction will be stored.
Two pass assembler process
Two pass assembler process
Pass 1
Pass 1
Pass 1
Pass 1
Pass 1
Pass 1
How to generate
object code?
Example-2