Redirected
edited by
1,780 views
0 votes
0 votes

Which activity is included in the first pass of two pass assemblers?

  1. Build the symbol table

  2. Construct the intermediate code

  3. Separate mnemonic opcode and operand fields

  4. None of these

edited by

3 Answers

2 votes
2 votes

The assembler generates correct instructions by scanning the program code twice. The first time it count how long the machine instructions will be to find out address of all the LABELS.

This first scan leads to creation of a symbol table that has list of all addresses and where they will be in the program. This table is know as symbol table.

On the second scan, machine code is generated and the symbol table is used to generate the correct addresses.

Therefore a 2 pass assembler scans the program and creates the symbol table in first pass and in second pass it generates the machine code.

Hence, Only Option A is right.

0 votes
0 votes

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.
  4. Separate the symbol, mnemonic, opcode and operand.
  5. Perform LC processing.
  6. Construct the Intermediate representation.

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.
  5. Process IR to synthesize the target program

A,B,C are correct.

Ref: https://gateoverflow.in/2721/gate1996-1-17

https://www.slideshare.net/dattatraygandhmal/assemblers-33585130 (slide 24)

edited by

Related questions

0 votes
0 votes
2 answers
1
go_editor asked Mar 27, 2020
3,765 views
Code optimization is responsibility of :Application programmerSystem programmerOperating systemAll of the above
0 votes
0 votes
1 answer
2
go_editor asked Mar 27, 2020
1,377 views
In two pass assembler the symbol table is used to store :Label and valueOnly valueMnemonicMemory Location
0 votes
0 votes
1 answer
3
Krithiga2101 asked Mar 27, 2020
373 views
Which activity is not included in the first pass of two pass assemblers ?Build the symbol tableConstruct the intermediate codeSeparate mnemonic opcode and operand fieldsN...
2 votes
2 votes
2 answers
4
go_editor asked Mar 27, 2020
863 views
Which of the following is not collision resolution technique?Hash addressingChainingBoth (A) and (B)Indexing