https://github.com/deveshsangwan/two-pass-assembler
A two pass assembler implementation in c++
https://github.com/deveshsangwan/two-pass-assembler
assembler cpp two-pass-assembler
Last synced: 6 months ago
JSON representation
A two pass assembler implementation in c++
- Host: GitHub
- URL: https://github.com/deveshsangwan/two-pass-assembler
- Owner: deveshsangwan
- License: gpl-3.0
- Created: 2020-09-17T10:50:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-02T16:47:10.000Z (over 5 years ago)
- Last Synced: 2025-01-15T02:35:12.144Z (about 1 year ago)
- Topics: assembler, cpp, two-pass-assembler
- Language: C++
- Homepage:
- Size: 108 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Two-Pass-Assembler
By [Devesh Sangwan](https://github.com/deveshsangwan), [Shikhar Panwar](https://github.com/shikharpanwar4)
This is a simple C++ implementation for a Two pass assembler.
# Overview of the Code
## pass1:
- Extracts all symbols and sections.
- A symbol and section table is generated and are stored in a csv file.
## pass2:
- Each instruction is converted to machine code.
- The programs again reads the symbol table to get address and size associated with each symbol.
## Other Functions:
- dec_to_bin(int) : Converts the given decimal number to the Binary String
- search_MOT(string) : It searchers the MOT for the Machine Operation Code and returns the index.
- search_symbol_table(string) : It searches the symbol_table and returns the address of the symbol.
- get_size(string) : It returns the size of the symbol/operation.
- get_data(string) : It extracts data from string and converts it into its binary equivalent.
- store_symbol_table() : Stores symbol table in csv format.
- store_sec() : Store section table in csv.
## Structures:
- mnemonics : Machine Operation Table
- symbol : Symbol Table
- section: Section Table
## Data Structures:
- Vector
- File Stream