recategorized by
19,686 views
27 votes
27 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.

recategorized by

2 Answers

Best answer
33 votes
33 votes
edited by
24 votes
24 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:

Related questions

14 votes
14 votes
2 answers
1
Kathleen asked Sep 29, 2014
6,354 views
A part of the system software which under all circumstances must reside in the main memory is:text editorassemblerlinkerloadernone of the above
1 votes
1 votes
1 answer
3
Kathleen asked Sep 13, 2014
5,088 views
Simpson's rule for integration gives exact result when $f(x)$ is a polynomial of degree$1$$2$$3$$4$
5 votes
5 votes
1 answer
4
Kathleen asked Sep 13, 2014
1,604 views
The differential equation $\frac{d^2 y}{dx^2}+\frac{dy}{dx}+\sin y =0$ is:linearnon- linear ...