In a two-pass assembler, symbol table is
2014
In a two-pass assembler, symbol table is
- A.
Generated in first pass
- B.
Generated in second pass
- C.
Not generated at all
- D.
Generated and used only in second pass
Attempted by 314 students.
Show answer & explanation
Correct answer: A
Answer: Generated in first pass.
Explanation: In a two-pass assembler the first pass scans the source to determine addresses and build the symbol table. The second pass uses that symbol table to resolve symbolic references and generate the final machine code.
First pass: assign location counters, record labels and their addresses into the symbol table, and process assembler directives that affect addresses.
Second pass: use the symbol table to replace symbols with actual addresses and generate object code; detect any undefined symbols.
Therefore the correct statement is that the symbol table is generated in the first pass and used during the second pass.