Skip to content

A SIC/XE assembler that reads SIC/XE programs from "Input.txt" and prints Location Counter, Symbol Table, Object Code, and HTE Record in "OUTPUT.txt". Built using C++.

Notifications You must be signed in to change notification settings

OmarKhalil2001/SIC-XE-Assembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

###SIC/XE ASSEMBLER PROJECT###

By Omar H. Khalil



Project Introduction:
Project.cpp reads SIC/XE code from input.txt and does assembler pass 1 and assembler pass 2 and generates the Symbol table, Location Counter, Object Code, and HTE record. The results are printed in OUTPUT.txt. The Project is completely built using C++17.

Project Implementation:
1- the function GetUp() loads instructions and registers data from instructions.txt and inserts them in a map and inserts other SIC/XE directives in sets.
2- The function pass1() starts reading the Input.txt file and builds location counter and symbol table. The function then returns 6 string vectors that include: Location Counter(in hexadecimal format), labels, instruction, references, symobal table (takes 2 vectors), program length.
3- the function pass1_2() calls function pass1 and then starts generating the object for each line. The algorithm first generates a binary string that represents the object code in binary format, and then starts manipulating the string based on the details of the instruction. Finally, it converts the binary string to hexadecimal format. It appends to the object code vector to 6 orginal vectors from pass1() and returns all of them.
4- the function HTE() uses data from pass1_2() to build the HTE record and prints it in OUTPUT.txt.
5- the function pass_and_print() calls the function pass1_2() and prints the data from them. The function then calls HTE().


Example Input/Output:
check files Input.txt and OUTPUT.txt

How to Run:
1- Download files: Project.cpp, Input.txt, OUTPUT.txt, and Instructions.txt.
2- Write your SIC/XE code in Input.txt and save.
3- Run Project.cpp.
4- Open OUTPUT.txt to view results.

About

A SIC/XE assembler that reads SIC/XE programs from "Input.txt" and prints Location Counter, Symbol Table, Object Code, and HTE Record in "OUTPUT.txt". Built using C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages