Question: MIPS Instruction ONLY!!! Prompt: During this programming assignment, you will be creating a useful tool for yourself for the remainder of this course. Given a

MIPS Instruction ONLY!!!

MIPS Instruction ONLY!!! Prompt: During this programming assignment, you will be creating

Prompt: During this programming assignment, you will be creating a useful tool for yourself for the remainder of this course. Given a user inputted number, either shift the number or isolate certain bits based on user input. Once the number has been altered and outputted, store into memory starting at the stack pointer ($sp), and ask the user if they would like to try again. Loop this process until the user gives the number O in response, saving the altered number to the stack each time (i.e. offsetting the address by 4 each time so as to not overwrite previous entries). Once the user chooses to quit, print out the values you have stored in memory. The cool thing you will end up with at the conclusion of this project is a shifting and isolating machine that can alter any number of your choice - something you can check future answers against! Note: Do not use pseudo instructions for this assignment. Explicitly allowed instructions are those on the MIPS green card from the core instruction set. Additionally, avoid using instructions we haven't introduced yet such as jal/jr, i.e., do not use any function/procedure calls in this assignment. Here is an example run of the program: Please enter a number: 5 Would you like to shift or isolate the number (0 or 1 respectively)? 0 Shift left or right (0 or 1)? 0 By how many bits? 2 Result: 20 Stored. Would you like to manipulate another number (0 for no, 1 for yes)? 0 History: 20 Here is an example, but instead with isolation: Please enter a number: 15 Would you like to shift or isolate the number (0 or 1 respectively)? 1 Enter the starting bit to isolate: 0 Enter the ending bit to isolate: 2 Result: 7 Stored. Would you like to manipulate another number (0 for no, 1 for yes)? 1 Please enter a number: 31 Would you like to shift or isolate the number (0 or 1 respectively)? 1 Enter the starting bit to isolate: 0 Enter the ending bit to isolate: 2 Result: 7 Stored. Would you like to manipulate another number (0 for no, 1 for yes)? 0 History: 7 7 A note on inputs: In order to verify your code, we will run it through some test cases. You do not need to do any conditional checking of inputs, as we will never give your program anything besides what is explicitly described. The exact range of the inputs is as follows: When first asking for a number, any 32 digit signed number can be expected. When asking for an operation (shift or isolate), the number 0 or 1 will be given. When asking for a shift operation, any number between 0 and 32 can be expected. When asking for a shift direction, a 0 or a 1 will be given. When asking for the starting and ending indices in the isolate operation, any number between 0 and 32 should be expected. When asking whether or not the user wants to manipulate another number, a 0 or 1 will be given. Prompt: During this programming assignment, you will be creating a useful tool for yourself for the remainder of this course. Given a user inputted number, either shift the number or isolate certain bits based on user input. Once the number has been altered and outputted, store into memory starting at the stack pointer ($sp), and ask the user if they would like to try again. Loop this process until the user gives the number O in response, saving the altered number to the stack each time (i.e. offsetting the address by 4 each time so as to not overwrite previous entries). Once the user chooses to quit, print out the values you have stored in memory. The cool thing you will end up with at the conclusion of this project is a shifting and isolating machine that can alter any number of your choice - something you can check future answers against! Note: Do not use pseudo instructions for this assignment. Explicitly allowed instructions are those on the MIPS green card from the core instruction set. Additionally, avoid using instructions we haven't introduced yet such as jal/jr, i.e., do not use any function/procedure calls in this assignment. Here is an example run of the program: Please enter a number: 5 Would you like to shift or isolate the number (0 or 1 respectively)? 0 Shift left or right (0 or 1)? 0 By how many bits? 2 Result: 20 Stored. Would you like to manipulate another number (0 for no, 1 for yes)? 0 History: 20 Here is an example, but instead with isolation: Please enter a number: 15 Would you like to shift or isolate the number (0 or 1 respectively)? 1 Enter the starting bit to isolate: 0 Enter the ending bit to isolate: 2 Result: 7 Stored. Would you like to manipulate another number (0 for no, 1 for yes)? 1 Please enter a number: 31 Would you like to shift or isolate the number (0 or 1 respectively)? 1 Enter the starting bit to isolate: 0 Enter the ending bit to isolate: 2 Result: 7 Stored. Would you like to manipulate another number (0 for no, 1 for yes)? 0 History: 7 7 A note on inputs: In order to verify your code, we will run it through some test cases. You do not need to do any conditional checking of inputs, as we will never give your program anything besides what is explicitly described. The exact range of the inputs is as follows: When first asking for a number, any 32 digit signed number can be expected. When asking for an operation (shift or isolate), the number 0 or 1 will be given. When asking for a shift operation, any number between 0 and 32 can be expected. When asking for a shift direction, a 0 or a 1 will be given. When asking for the starting and ending indices in the isolate operation, any number between 0 and 32 should be expected. When asking whether or not the user wants to manipulate another number, a 0 or 1 will be given

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!