CS423 Systems Programming Project Exam (461 Fall 2024-2025) PDF

Summary

This is a project exam for CS423 Systems Programming, taken in Fall 2024-2025. The exam covers multi-operand operations and a new format for a SICXE machine. It includes instructions and requires the addition of new keywords, rules, and semantic actions to an assembler.

Full Transcript

Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬ Ministry of Higher Education ‫وزارة التعليم العالي‬ College of computer...

Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬ Ministry of Higher Education ‫وزارة التعليم العالي‬ College of computer ‫كلية الحاسب‬ Department of Computer Science ‫قسم علوم الحاسب‬ Course: CS423 "Systems Programming" Project exam Semester 461-Fall 2024-2025 Duration: 45 mins Mark________/25 Week 15 Student Name: Student ID: Will Not have a Mark: It is only to test yourself For Instructor use only Outcomes 1 2 3 4 5 6 Course covering Level    Question 1 2 3 Total Covered Outcome 5 5 5 5 exam Allocated mark 11 10 4 25 Earned mark Exam starts here We are adding a new format for SICXE machine. Multi-Operand operations: Any F2 or F3 format instruction can be used between more than two registers or memory addresses. When the user types a star ‘*’ before the instruction mnemonic (either F2 or F3) then the format will be as follows: Only instruction format F2 is considered in this exam. In this case, all the operands after are registers. We can have 1 to 4 registers. Example: * ADDR 3, A, X, T where 3 is the number of used operands. The General syntax of this format is: stmt → * F2 NUM , REG rest20 rest20 → , REG rest20 |  where “, REG” should be repeated value of NUM times The translation of this kind of instruction is: 6 bits 2 bits 4 bits 4 bits 4 bits 4 bits Opcode Number register 1 register 2 register 3 register 4 of operands Max number of operands is 4. If the number is less than 3 then the fields that are not used are cleared. Hint that is given only in this “test-yourself exam”: 1- If there is any new keyword add it (with its string, token, and attribute) to the keyword (either instruction or directive) table (in instfile). 2- add the code for the new rules of the grammar 3- add the semantic actions for pass1 if any: mainly if the locctr should be modified 4- add the semantic actions for pass2: you should collect any field where it should be found and put it in the inst where it should be put. 5- print the instruction at the end. 6- good luck 1 Add this new Format to your assembler 1) Write the added code here: Only added code elif lookahead == '*': # stmt  *F2 NUM, REG rest20 locctr += 3 match('*') if pass1or2 == 2: inst = symtable[tokenval].att

Use Quizgecko on...
Browser
Browser