q explain about two-pass assemblerassemblers


Q. Explain about Two-pass assembler?

Assemblers usually make two or more passes through a source program in order to resolve forward references in a program. A forward reference is expressed as a type of instruction in code segment which is referencing the label of an instruction though the assembler hasn't yet encountered the definition of that instruction.

Pass 1:  Assembler reads the whole source program and creates a symbol table of labels and names used in the program that is name of data fields and programs labels and their relative location (offset) within the segment.

Pass 1 concludes the amount of code to be produced for every instruction. 

Pass 2:Assembler uses the symbol table which it constructed in Pass 1. Now it knows the relative position and length of every data field and instruction and it can complete object code for every instruction.  It generates .OBJ (Object file), .LST (list file) and cross reference (.CRF) files.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: q explain about two-pass assemblerassemblers
Reference No:- TGS0327882

Expected delivery within 24 Hours