The Gateway to Computer Science Excellence
+26 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$

in Compiler Design by Veteran (52.2k points)
edited by | 3.6k views

Is it the total no of passes once or twice each of the activities will go through?

or the ith   pass the activity will be in, where i = 1,2?

is two pass assmbler in the syllabus?
What does it mean by "listing printed ".

2 Answers

+32 votes
Best answer

Ans should be (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
by Boss (17.1k points)
edited by
Thank you for nice explanation!
someone, please explain option 4(address resolution), Why is it pass 1 and not pass 2

@srestha mam

what is listing printed???Schemantic actions??


2 pass assembler property

See ans line

  1. Write the program and the assembling listing
+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
by Loyal (8.1k points)
edited by
address resolution is done by the not done by assembler

plz explain why option d is done in 1st pass of assembler
What is back end activity  ? plz explain.

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
50,737 questions
57,354 answers
105,248 users