1. Homepage
  2. Programming
  3. CS 530 Systems Programming Assignment 1 - Parsing Object Code Text Records

CS 530 Systems Programming Assignment 1 - Parsing Object Code Text Records

Engage in a Conversation
CS530Systems ProgrammingCC++Parsing Object Code Text RecordsSDSU

CS 530 CourseNana.COM

Assignment 1 - Parsing Object Code Text Records Points: 80
Due Date: Beginning of the class, 10/02/2024
CourseNana.COM

Introduction CourseNana.COM

As we move on to the discussion on Assemblers, you will be implementing a disassembler as the major programming exercise for the course. A disassembler is a computer program that translates the machine language into assembly language. Since creating a disassembler is rather a large task, the work will be split between two assignments. CourseNana.COM

Task CourseNana.COM

This first assignment will be focused on reading and parsing the SIC/XE object code and printing out the details of each instruction in the text records of the object code in the order of how they appear in the object code. Each instruction has its opcode (mnemonic), operand/s, and addressing mode/s. The composition of the object code structure includes the header record, the text records where each text record contains a series of instructions, modification records (if there are any), and the end record. In this assignment, you would ONLY need to focus on the text records. CourseNana.COM

Input and Output Files CourseNana.COM

Input File:
o Object Code file:
test.obj CourseNana.COM

o This file name would be passed as a command line argument to your project. Output File: CourseNana.COM

o Object code structure in text form: obj_struct.txt. Note: CourseNana.COM

  • ●  Your program should produce the output file with the exact name obj_struct.txt to work with the autograder. CourseNana.COM

  • ●  The obj_struct.txt file should follow exactly what appears in the sample example_obj_struct.txt using the exact format. CourseNana.COM

o The output file will have the following 5 columns in that order: Instruction, Format, Operand Addressing Type, Target Address Addressing Mode, and Object Code. CourseNana.COM

Instruction – print the mnemonic (big case) of the instruction: LDA, ADD, ... CourseNana.COM

  • ▪  Format – print the format number: 2, 3, or 4. Do NOT need to consider format 1 in this assignment. CourseNana.COM

  • ▪  Operand Addressing Type – print the addressing mode for computing the operand: simple, immediate, indirect CourseNana.COM

  • ▪  Target Address Addressing Mode – print the addressing mode for computing the CourseNana.COM

    target address: pc, base, or absolute (equivalent to direct) CourseNana.COM

If indexed addressing mode is used, then print pc_indexed, base_indexed, CourseNana.COM

or direct_indexed.
Object Code – print Object code for each instruction CourseNana.COM

o The output file should print the first line with the column header acronyms (exactly as below): CourseNana.COM

INSTR FORMAT OAT TAAM OBJ
o There need to be some spaces separating columns in the obj_struct.txt. The number of CourseNana.COM

spaces for the separation is flexible. It is recommended to set the columns with a consistent CourseNana.COM

width of 16 characters so the output format looks consistent with autograder output.
o Some columns might be blank, such as format 2 addressing modes, if that is the case, leave the addressing mode columns blank. (It would be good to still add spaces to keep columns CourseNana.COM

lined up for easier reading.) CourseNana.COM

Required Features CourseNana.COM

  • ●  Your program MUST support format 2, 3, 4 instructions and does NOT need to support format 1 instructions. CourseNana.COM

  • ●  Your program shall support the parsing of all 59 instructions (except format 1 instructions) 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. CourseNana.COM

const static string ops[] = { "18", "58", "90", "88", "A0", "24", "C0", "F4", "3C", "48", "00", "68", "6C", "74", "04", "98", "C8", "44", "A4", "A8", "F0", CourseNana.COM

"54", "80", "D4", "84", "10", "1C", "E0", "F8", "2C", CourseNana.COM

"40", "B4", "28", "64", "9C", "C4", "30", "34", "38", "50", "70", "08", "D0", "20", "60", "D8", "AC", "4C", "EC", "0C", "78", "14", "7C", "E8", "5C", "94", "B0", CourseNana.COM

"B8", "DC" const static string mnemonics[] = { CourseNana.COM

"ADD", "ADDF", "ADDR", "AND", "CLEAR", "COMP", "COMPF", "COMPR", "DIV", "DIVF", "DIVR", "FIX", "FLOAT", "HIO", "J", "JEQ", "JGT", "JLT",
"JSUB", "LDA", "LDB", "LDCH", "LDF", "LDL",
CourseNana.COM

"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" CourseNana.COM

}; CourseNana.COM

const static bool format2[] = { false,false,true,false,true,false, CourseNana.COM

false,true,false,false,true,false, false,false,false,false,false,false, false,false,false,false,false,false, false,false,false,false,false,false, true,false,false,false,true,false, true,true,false,false,false,false, false,false,false,false,false,false, false,false,false,false,true,true, false,false,false,true,false CourseNana.COM

}; CourseNana.COM

Programming and testing CourseNana.COM

You must use C/C++ for this assignment. The compiler used for autograder is gcc version 4.8.5 or version 7. CourseNana.COM

  • ●  Refer to “C/C++ programming in Linux / Unix” page. CourseNana.COM

  • ●  You may use C++ 11 standard for this assignment, use the compilation flag -std=c++11, see the given CourseNana.COM

    Makefile. CourseNana.COM

  • ●  You are strongly recommended to set up your local development environment under a Linux CourseNana.COM

    environment (e.g., Ubuntu 18.04 or higher), develop and test your code there first, then port your code to Edoras (e.g., filezilla or scp) to compile and test to verify. The gradescope autograder will use a similar environment as Edoras to compile and autograde your code. CourseNana.COM

    Compilation and execution CourseNana.COM

  • Compilation: The command make will be used to compile your program. You MUST provide an appropriate makefile, an example makefile file can be found at CourseNana.COM

  • Executable Name: Please generate your disassembler executable file with a name disassem. The autograder will fail, and you will lose points if we need to modify your executable name to make the CourseNana.COM

autograder work. Make sure to use the “-o” disassem flag in your Makefile compilation command, also CourseNana.COM

the Makefile should use a “-g” compile flag to enable gdb debugging.
Before submitting, port your code to Edoras (via filezilla or scp) to compile and test to verify. Note the CourseNana.COM

gradescope autograder will use a similar environment as Edoras to compile and autograde your code. CourseNana.COM

ExecutableCommandLineArguments:Thedisassemblershouldusetheobjectcodefilenameasthe command line arguments for execution. If the object code file is not present, then the program should exit by displaying a message “missing the input file” asking for the missing input file. The following shows how your executable will be called: CourseNana.COM

./disassem test.obj CourseNana.COM

Grading CourseNana.COM

Passing tests against your program execution may NOT give you a perfect score. The satisfaction of the requirements (see above), your code structure, coding style, and comments will also be part of the rubrics (see Syllabus Course Design - assignments). Your code shall follow industry best practices: CourseNana.COM

  • ●  Be sure to comment on your code appropriately. Code with no or minimal comments is automatically lowered by one grade category. CourseNana.COM

  • ●  NO hard code – Magic numbers, etc. CourseNana.COM

  • ●  Have proper code structure between .h and .c / .cpp files, do not #include .cpp files. CourseNana.COM

  • ●  Design and implement clean interfaces between modules. CourseNana.COM

    Turning In CourseNana.COM

    Submit the following program artifacts on Gradescope. Make sure that all submitted files contain your name and Red ID. CourseNana.COM

Program Artifacts
o Source code files (.h, .hpp, .cpp, .C, or .cc files, etc.), Makefile.
o Submit files as they are, DO NOT compress files into a zip file. CourseNana.COM

  • ●  Single Programmer Affidavit (refer to here), no digital signature is required, type your name and Red ID as the signature. CourseNana.COM

  • ●  Number of submissions CourseNana.COM

o Please note the autograder submission count when submitting on Gradescope. For this CourseNana.COM

assignment, you will be allowed 20 submissions, but future assignments will be limited to around 10 submissions. As stressed in the class, you are supposed to do the testing in your own dev environment instead of using the autograder for testing your code. It is also the responsibility of you as the programmer to sort out the test cases based on the requirement specifications instead of relying on the autograder to give the test cases. CourseNana.COM

Late Submission Policy CourseNana.COM

Refer to the Syllabus for the Late Submission Policy. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
CS530代写,Systems Programming代写,C代写,C++代写,Parsing Object Code Text Records代写,SDSU代写,CS530代编,Systems Programming代编,C代编,C++代编,Parsing Object Code Text Records代编,SDSU代编,CS530代考,Systems Programming代考,C代考,C++代考,Parsing Object Code Text Records代考,SDSU代考,CS530help,Systems Programminghelp,Chelp,C++help,Parsing Object Code Text Recordshelp,SDSUhelp,CS530作业代写,Systems Programming作业代写,C作业代写,C++作业代写,Parsing Object Code Text Records作业代写,SDSU作业代写,CS530编程代写,Systems Programming编程代写,C编程代写,C++编程代写,Parsing Object Code Text Records编程代写,SDSU编程代写,CS530programming help,Systems Programmingprogramming help,Cprogramming help,C++programming help,Parsing Object Code Text Recordsprogramming help,SDSUprogramming help,CS530assignment help,Systems Programmingassignment help,Cassignment help,C++assignment help,Parsing Object Code Text Recordsassignment help,SDSUassignment help,CS530solution,Systems Programmingsolution,Csolution,C++solution,Parsing Object Code Text Recordssolution,SDSUsolution,