Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Submission Instructions: 1. Please submit your work directly in Canvas (using the Canvas editor) or as a text/MSword/PDF attachment by the due date/time. Please use
Submission Instructions: 1. Please submit your work directly in Canvas (using the Canvas editor) or as a text/MSword/PDF attachment by the due date/time. Please use only zip for compression. It must be typed, not a scan of handwriting. 2. Please write your name in the assignment header and as a part of attached file names. 3. It must be your own work - a penalty of at least one grade in your final grade and a report to the Dean of Students will result from sharing work or using other people work. 4. Please submit your assignment by the deadline - late submissions will not be accepted unless coordinated with the instructor. In this case, please submit your assignment to the Canvas Drop Box assignment. 5. Do not submit your assignment via email. If you have a justified documented reason for being late, then after obtaining permission from the instructor you should submit the assignment to your Canvas drop-box Assignment and notify me by email. 6. A grade of 1 denotes an issue with your assignments, which you have to resolve with the instructor. 7. Your deliverables for this assignment are the pseudo assembly language code. The code should include remarks that explain any non-trivial part of the program. Background: - This assignment includes a simple C++ pseudo-code. - It is referred to as pseudo code because it is not necessarily compliable by C++ compilers and due to the use of MIPS register names instead of variables. - Additional resources, and/or pointers to these resources, are available on Canvas. Assignment Instructions: Consider an imaginary version of the MIPS (MIPS2), with 2 operand instructions, that includes the following instructions (e.g., add x,y means xx+y ): or x,$y; and x,y; add x,y; sub x,y; notx(xx); li x, constant (x constant) sll x, constant (xx2constant; srl x, constant (xx/2constant);xorx,y Translate the following Pseudo C++ program snippet to MIPS2 assembly. Provide the assembly code as a text file. You can use any unused T($t5$ t9) or S($S3$S7) registers as temporaries. Do not simplify expressions. Program snippet: int $t0,$t1,$t2,$t3,$t4;// assume that $z denotes a MIPS2 register that holds an integer. bool \$s0, \$s1, \$s2; // assume that \$z denotes a MIPS2 register that holds an integer. ... // Initialize register values with constants (using the li instruction) as you see fit. // Use SLL/SRL for multiplication and division $t0=5$t1+($t2$t316)$t2+($t1/8+$t4)$t0=6+($t23)$t2+($t1/32+4)+$t1;$t0=$t1+($t23)($t2$t0)+($t1&$t3);#denotesbitwisenot,denotesXOR$s0=($s1$s2)&&(($s1)$s2)true
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started