Professional Documents
Culture Documents
Prepared By:
Shifali Sharma
Apex Institute of Technology- MBA
Apex Institute of Technology- CSE
Definition
• An assembler is a translator that translates source
instructions (in symbolic language) into target
instructions (in machine language), on a one to one
basis.
• An assembler is a translator that translates a
machine oriented language into machine language.
• Imperative Statements
– An Imperative statement indicates an action to be
performed during the execution of assembled
program.
– MOVER AREG A
– PRINT B
• Declarative Statements
– DS : reserves areas of memory and associates
name with them
– DC : constructs memory word containing
constants
– A DS 5
– B DC 3
• Assembler Directive:
– Instruct the assembler to perform certain actions
during assembly of program.
– START : directive instruct the assembler to place
first word of the target program to generate by it
in memory word having the address (constant).
• START 100 Set LC=100
– END : directive indicate the end of the source
program.
• Pass 1:
– Separate the symbols, literals, mnemonics and
operand fields.
– Build the Symbol and Literal Table.
– Perform LC processing
– Construct intermediate representation
• Pass 2:
– Synthesize the target code
Pool Table
Pool Table
Pool Table
0
1
2
3
4
5
5
Apex Institute of Technology- CSE
Two Pass Assembler
Source POOLTAB
Program
LITTAB
Object
SINGLE PASS
Code
ASSEMBLER
SYMTAB
MOT POT
TII