edited by
12,698 views
38 votes
38 votes

The pass numbers for each of the following activities

  1. object code generation

  2. literals added to literal table

  3. listing printed

  4. address resolution of local symbols that occur in a two pass assembler

respectively are

  1. $1, 2, 1, 2$

  2. $2, 1, 2, 1$

  3. $2, 1, 1, 2$

  4. $1, 2, 2, 2$

edited by

2 Answers

Best answer
40 votes
40 votes

Correct Option: B

The functions performed in pass $1$ and pass $2$ in $2$ pass assembler are

Pass $1$

  1. Assign addresses to all statements in the program.
  2. Save the values assigned to all labels for use in pass $2$
  3. Perform some processing of assembler directives.

Pass $2$

  1. Assemble instructions.
  2. Generate data values defined by BYTE, WORD etc.
  3. Perform processing of assembler directives not done during pass $1$.
  4. Write the program and the assembling listing
edited by
7 votes
7 votes
i think ans should be B.

literals added to literal table is done in lexical analysis phase, so possible in 1 pass.

and a is back end activity so can not in 1 pass.

d is back end activity but it is in 2 pass assembler. so only 1 pass required.

hence B
edited by
Answer:

Related questions