Wednesday, September 24, 2008

Assembly language (The Forward Reference)

Each reading of the source program is called a pass. Any translator which reads the input
program once is called a one-pass assembler and if it reads twice is called a two-pass
assembler.
Two - pass assembler:
1. In pass-one of a two-pass assembler, the definitions of symbols, statement labels etc
are collected and stored in a table known as the symbol table.
2. In pass-two, each statement can be read, assembled and output as the values of all
symbols are known.
This approach is thus quite simple though it requires an additional pass.
One - pass assembler:
The assembly program is read once and converted to an intermediate form and thereafter
stored in a table in memory

No comments: