The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+16 votes

A simple two-pass assembler does the following in the first pass:

  1. It allocates space for the literals.

  2. It computes the total length of the program.

  3. It builds the symbol table for the symbols and their values.

  4. It generates code for all the load and store register instructions.

  5. None of the above.

asked in Compiler Design by Veteran (59.6k points) | 3k views

4 Answers

+24 votes
Best answer
answered by Veteran (363k points)
edited by
Sir this link is not opening so pls provide another good link of answer.
in option c wht about unresolved symboles
+8 votes

A,B,C are correct 

scan the code twice. The first time, just count how long the machine code instructions will be, just to find out the addresses of all the labels. Also, create a table that has a list of all the addresses and where they will be in the program. This table is known as the symbol table. On the second scan, generate the machine code, and use the symbol table to determine how far away jump labels are, and to generate the most efficient instruction.


answered by Active (2.7k points)
0 votes
Option D & E is Incorrect.
answered by (91 points)
–1 vote
answer - C
answered by Loyal (9.1k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,599 questions
48,600 answers
63,739 users