0% found this document useful (0 votes)
41 views3 pages

Experiment No.: - 01 Title

The document describes the aim, theory, and process of the first pass of a two-pass assembler. The assembler generates an object file with machine code and a list file with assembly code and offsets. The first pass isolates instruction components, checks validity, updates symbol tables, and increments the location counter. It identifies labels, mnemonics, operands, and comments to prepare for the second pass of synthesis which obtains opcodes, fills addresses, and writes information to the object file. The experiment's aim was to design and implement the first pass successfully.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views3 pages

Experiment No.: - 01 Title

The document describes the aim, theory, and process of the first pass of a two-pass assembler. The assembler generates an object file with machine code and a list file with assembly code and offsets. The first pass isolates instruction components, checks validity, updates symbol tables, and increments the location counter. It identifies labels, mnemonics, operands, and comments to prepare for the second pass of synthesis which obtains opcodes, fills addresses, and writes information to the object file. The experiment's aim was to design and implement the first pass successfully.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

EXPERIMENT NO.

: - 01

Title: Two Pass Assembler

Aim: - Design and implementation of pass1 of two-pass assembler for general machine.

System Software/ Instruments/ Equipment’s Requirements: - gedit, gcc

Theory/ Working Principle:


If the source program is in assembly language of the machine, the object code is in the machine
language of same machine and translation is executing on the same machine. Assembler
generates two files. One is object file with .obj extension and the other is list file with .lst
extension. The object file contains the binary code for instruction and information about
object instruction. The list file contains assembly language statements, binary code for
each instruction and offset for each instruction
There are two phases of assembler design :
 Analysis phase

2. Synthesis phase
These phases performs following tasks :
1. Analysis phase :
1.a.a) Isolate label, mnemonic opcode, operands and comment of statement.
1.a.b) Check validity of mnemonic opcode by consulting MOT.
1.a.c) Check the no. of operands required for an instruction by consulting MOT.
1.a.d) Process the labels or symbols appropriately and fill ST(Symbol Table).
1.a.e) Update LC appropriately by consulting MOT for the length of instruction.
1.a.f) Ignore comments.
1.a.g) Take proper actions for pseudo opcodes by consulting POT.
2. Synthesis phase :
1.a) Obtain machine opcode consulting to MOT corresponding to mnemonic.
1.b) Filll in address of symbols or labels by consulting ST.
1.c) Write the above information in output object file.
// Draw flowchart for PASS1

Program:

Output:
Conclusion: - Successfully designed pass 1 in Two pass assembler.

You might also like