pie-humble-pie / 2-Pass-Assembler

C++ code for 2 Pass Assembler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2-Pass-Assembler

C++ code for 2 Pass Assembler

This is a simple C++ code for 2 pass assembler.

Over-review of the Code

There are 2 main methods:

Pass 1: It creates 2 csv files for symbol table and section table respectively. Pass 2: It finalize the machine code for the given tables and code. (It does not create machine code for registers defined within the code.)

Other Functions:

  1. convert(int) : Converts the given decimal number to the Binary String
  2. inti() : Initialize the Machine Opcode Array with Name, Binary Code and Size.
  3. search_mot(string) : It searchers the MOT for the asked Machine Code and returns index in array.
  4. search_symbol(string) : It searches the SYMLAB and returns the location of the symbol.
  5. size_evaluation(string) : It returns the size of the variable.
  6. data_break(string) : It takes value string and converts it into Binary.
  7. store_symlab() : Stores symbol table in csv format.
  8. store_sec() : Store section table in csv.

Structures:

  1. mnemonics : Machine Opcode Table
  2. symbol : Symbol Table
  3. section: Section Table

Data Structures:

  1. Vector
  2. File Stream

Thank You. For any queries you can mail me at: krishna.dduc@gmail.com

About

C++ code for 2 Pass Assembler


Languages

Language:C++ 100.0%