Question: CSC 256-02 Assignment 2 (Total : 100 points) 1. In MIPS, how to use one line instruction li to assign value 10 (decimal) to register

 CSC 256-02 Assignment 2 (Total : 100 points) 1. In MIPS,

CSC 256-02 Assignment 2 (Total : 100 points) 1. In MIPS, how to use one line instruction "li" to assign value 10 (decimal) to register $81? (5 points) 2. In MIPS, how to use one line instruction "addi" to assign value 10 (decimal) to register $s1? (5 points) 3. In MIP, The compiler decides variable xregister $so, variable y register Ssl, variable z register $s2, 1) How to translate "x=3" from c++ to MIPS assembly language (in Mars)? (2 points) 2) How to translate "y=5" from c++ to MIPS assembly language (in Mars)? (2 points) 3) How to translate "x=3; y=5; z=x-y" from C++ to MIPS assembly language (in Mars). (5 points) 4) Type your 3 3) answer into Mars as a piece of code. Save it. Assemble it and Run it. What shows in the value of $s2 at the right chart of MARS Register? (5 points) 5) How to translate "x=3; y=5; Z=x-y-100" from C++ to MIPS assembly language (using Mars) (Hint: you need to save the result of x-y into another intermediate register.) (10 points) 6) Type your 3 5) answer into Mars as a piece of code. Save it. Assemble it and Run it. What shows in the value of $s2 at the right chart of MARS Register?(6 points) 4. Please convert decimal -256 into four-digit Two's complement hex. (Hint: assignment_2_reading slides and Chapter_2_02_report_Q1_Answer slides on iLearn.) (Show intermediate steps clearly. You do not receive any credit for just writing down the answer). (10 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!