( C/C++ ) Design and implement a Disassembler for the XE variant of the SIC/XE machines ( C/C++ )

profileabdullah64446
details.pdf

Systems Programming

As we are wrapping up the discussion on Assemblers, you will be implementing a

disassembler for this assignment 1. Disassembler is basically a computer program that

translates the machine language into assembly language.

Teams:

You can pair in a group of 2 to 4 students and collaborate while coding for this

assignment, but you should provide learning outcomes for everyone in the group

separately in a document. You should not collaborate with anyone else other than

your teammate. Do NOT exchange your code with other teams. Do NOT copy and

paste code from any online resource. You can do this assignment on your own as

well if you are not comfortable working in a group.

Programming languages:

You must use C/C++ for this assignment.

Task

Design and implement a Disassembler for the XE variant of the SIC/XE machines. The

disassembler should be able to open the object code file along with its accompanying

symbol file and then it should disassemble the object code and create an SIC/XE source file

and an assembly listing file using the disassembler program you have written. Note the

symbol file should contain SYMTAB and LITTAB tables generated from the assembling

process.

Example input and output files (all in text file format) are given as follows:

1) Input files:

a. Object Code file: sample-obj.txt

b. Symbol file: sample.sym.txt

2) Output files:

a. SIC/XE source file: sample.sic.txt

b. Assembly listing file: sample.lis.txt

Your disassembler shall support the translation between all 59 operation codes and their

corresponding mnemonics in the SIC/XE architecture, for example, the mapping between

the following two arrays. Note: you do NOT have to use the following data structures in

your assignment implementation.

const static string ops[] = { "18", "58", "90", "40", "B4", "28", "88", "A0", "24", "64", "9C", "C4", "C0", "F4", "3C", "30", "34", "38", "48", "00", "68", "50", "70", "08", "6C", "74", "04", "D0", "20", "60", "98", "C8", "44", "D8", "AC", "4C", "A4", "A8", "F0", "EC", "0C", "78", "54", "80", "D4", "14", "7C", "E8", "84", "10", "1C", "5C", "94", "B0", "E0", "F8", "2C", "B8", "DC"

};

const static string mnemonics[] = { "ADD", "ADDF", "ADDR", "AND", "CLEAR", "COMP", "COMPF", "COMPR", "DIV", "DIVF", "DIVR", "FIX", "FLOAT", "HIO", "J", "JEQ", "JGT", "JLT", "JSUB", "LDA", "LDB", "LDCH", "LDF", "LDL", "LDS", "LDT", "LDX", "LPS", "MUL", "MULF", "MULR", "NORM", "OR", "RD", "RMO", "RSUB", "SHIFTL", "SHIFTR", "SIO", "SSK", "STA", "STB", "STCH", "STF", "STI", "STL","STS", "STSW", "STT", "STX", "SUB", "SUBF", "SUBR", "SVC", "TD", "TIO", "TIX", "TIXR", "WD"

};

Important notes:

1) Executable Name:

a. Please generate your dissembler executable file with a name dissem.

2) Executable Command Line Arguments:

a. The disassembler should use the object code file name and its accompanying

symbol file name, in that order, as the command line arguments for

execution. If either the object code file or the symbol file is not present, then

the program should exit by displaying message asking for the missing input

file/s.

3) Source Code Commenting:

a. Your program should have right comments at appropriate places, refer to the

best programming practices in the Syllabus on Canvas. Points will be

deducted if your code does not have good comments.

4) Plagiarism Check:

a. Points will be deducted if there is a plagiarism found in your code. An

automated program structure comparison algorithm will be used to detect

software plagiarism. An affidavit of academic honesty stating the program is

written by your group will need to be submitted along with your submission

of the code, see below.

What to turn in:

1) You should turn in your assignment files by uploading them through the Canvas

assignment 1 submission.

a. If you worked as a group on the assignment, please submit the following artifacts

by ONLY ONE group member in your group:

i. Make sure that all files (Affidavit, README, source files, header files,

Makefile) contains each team member’s names and RedIDs!

ii. Academic Honesty Affidavit:

1. Pair programming Equitable Participation & Honesty Affidavit with

all members’ names listed on it. Use the pair-programmer

affidavit template.

2. If you worked alone on the assignment, use the single-

programmer affidavit template.

iii. Source code files, header files, Makefile (a sample Makefile is provided

for compiling and linking C++ code to generate an executable file).

iv. All test files which you have used while testing your disassembler.

v. A README file explaining the algorithm which you have designed for the

disassembler. You should explain your thought process behind the code

and its steps. You can include description, diagrams/drawings.

vi. Enter any comments in the assignment’s turnin.

b. Everyone must also submit a document

README_LearningOutcome_StudentName (Text, WORD, or PDF) explaining the

learning outcomes after doing this assignment.

2) Have the SAME person (who submitted the artifacts to Canvas) create a directory named

“a2” (~/a2) under that person’s class account on Edoras, put the source code files,

header files, Makefile, and README file into the ~/a2 directory, as well as any test files

used for doing the assignment.