• recategorized by
23,593 views
35 35 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.

3 Answers

Best answer
40 40 votes
• edited by
27 27 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.

Reference-http://users.cis.fiu.edu/~downeyt/cop3402/two-pass.htm

Answer:
Position:
Show:

Related questions

18 18 votes
2 answers 2 answers
9.3k
9.3k views
Kathleen asked Sep 29, 2014
9,295 views
A part of the system software which under all circumstances must reside in the main memory is:text editorassemblerlinkerloadernone of the above
33 33 votes
4 answers 4 answers
18.6k
18.6k views
Kathleen asked Sep 29, 2014
18,617 views
Consider a simple connected graph $G$ with $n$ vertices and $n$ edges $(n 2)$. Then, which of the following statements are true?$G$ has no cyclesThe graph obtained by re...
1 1 vote
1 answers 1 answer
5.9k
5.9k views
Kathleen asked Sep 13, 2014
5,936 views
Simpson's rule for integration gives exact result when $f(x)$ is a polynomial of degree$1$$2$$3$$4$
7 7 votes
1 answers 1 answer
2.9k
2.9k views
Kathleen asked Sep 13, 2014
2,947 views
The differential equation $\frac{d^2 y}{dx^2}+\frac{dy}{dx}+\sin y =0$ is:linearnon- linear ...