The objective is to implement a version of a two-pass SIC/XE assembler. The Assembler implemented includes all the SIC/XE instructions and supports all four formats 1, 2, 3, 4, addressing modes, and program relocation. It also supports a machine-independent feature i.e., program blocks.
There are four source files:
- Tables.cpp (Contains OPTAB, SYMTAB, REGTAB and Block Table)
- Utility.cpp (Contains functions that would be useful during pass1 and pass2 implementation)
- Pass1.cpp (Execution of pass 1)
- Pass2.cpp (Execution of pass 2)
Assembler source program using the instruction set of SIC/XE stored as a text file i.e., 'input1.txt'
The Assembler will generate the following files as output:
- Symbol Table (SYMTAB) i.e., 'tables_input1.txt'
- Intermediate file i.e., 'intermediate_input1.txt'
- Listing file (it will contain the input assembly code with address, block number, and object code of each instruction) i.e., 'listing_input1.txt'
- Object program (includes H, T, M, and E records) i.e., 'object_input1.txt'
- Error file (displays the errors in the assembly program, if any) i.e., 'error_input1.txt'
- Open command prompt/terminal in the same directory as the source files.
- Type the following command - g++ -std=c++11 pass2.cpp -o ./assembler.out
(It will generate an object file named 'assembler.out' in the current directory)
(You can generate the 'assembler.out' file in any directory as long as it is in the same directory as the input file) - Now run the assembler.out file by typing the following command - '.\assembler.out' (For cmd - windows)
'./assembler.out' (For terminal - MAC/Linux) - Type the name of the input file (with extension), in our case 'input1.txt', to generate the object code file i.e., 'object_input1.txt' and all the additional files.
(The files will be generated in the same folder)
Created by Devansh Garg - feel free to contact me!
dgarg1806@gmail.com