One pass & Two pass Assembler
Two pass translation
- Two pass translations consist of pass I and pass II.
- Generally, LC processing performed in the first pass and symbols defined in the program entered
into the symbol table, hence first pass performs analysis of the source program.
- So, two pass translation of assembly lang. the program can handle forward reference easily.
- The second pass synthesizes the target form using the address information found in the symbol table.
- Moreover, The first pass constructs an intermediate representation of the source program and that will be used by the second pass.
- IR consists of two main components: data structure + IC (intermediate code)
- Similarly, A one-pass assembler requires 1 scan of the source program to generate machine code.
- Moreover, The process of forwarding references talked using a process called back patching. The operand field of an instruction containing forward references left blank initially.
- Also, A table of instruction containing forward references maintained separately called table of
Incomplete Instruction (TII)
This table can use to fill-up the addresses in incomplete instruction. The address of the forward referenced symbols put in the blank field with the help of the back-patching list.