Skip to content

An assembler, in short, is a code/software which translates assembly language code into machine code. In this repository, I have implemented a two pass assembler in python which translates assembly code in machine code in two passes.

Notifications You must be signed in to change notification settings

rupesh-dharme/Two-Pass-Assembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two Pass Assembler

An assembler is a program that translates assembly language code into machine language code.

Types of assemblers

  1. One pass assembler
  2. Two pass assembler

About this Repository

This is my implementation of a pseudo assembler in python which tries to simulate a two pass assembler.

Let's see how a two pass assembler works in short. It takes an .asm file(here it does take .txt) and a MOT and converts it into an intermediate code after pass 1. In pass one Symbol table and Literal table are also created which are used in pass two(also pool table).

In pass 2 the IR file is converted into machine code using ST and LT. That is a short overview you can read more here.

Here are some output snaps.

Pass 1

snap01 snap02

Pass 2

snap01 snap02

Though this won't simulate an assembler completely and may sometime give wrong outputs. An actual assembler is far more complex and efficient.

About

An assembler, in short, is a code/software which translates assembly language code into machine code. In this repository, I have implemented a two pass assembler in python which translates assembly code in machine code in two passes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages