Question: Background: In the last two machine problems, you wrote a MIPS program that computed each successive value of a cube function from an earlier value

 Background: In the last two machine problems, you wrote a MIPS
program that computed each successive value of a cube function from an

Background: In the last two machine problems, you wrote a MIPS program that computed each successive value of a cube function from an earlier value of the function. The interesting part of the program (shown in bold below in C++) was set up to computes sl=1=1, 52-2-8, 53-3--27.54-4-64 and 55-5-125 (assuming Stl and Sto were initialized properly) ti += to: t2 += 1; s2 - 3l + t2; ti + to: t2 += t1; 33 = s2 + t2; tl + to; t2 += ti; 34 = 33 + t2; tl + to: t2 += ti; s5 - 54 + t2; This program could have been translated into the machine language from any manufacturer --for example, on a Pentium-class machine. But for the last two machine problems, the above program (together with the initialization steps not shown here) were translated into assembly language in MP1 and then (for just the instructions corresponding to the above bold code) into machine language in MP2. The hexadecimal for those instructions are specific to MIPS. Remember, the basic syntax of every SPIM program is: .data stri: .ascii2" .text globl main main: user instructions go here li $v0, 10 # Set system call to exit syscall # Perform exit from program The data segment is where your data is stored, and the text segment is where your program is stored. This assignment illustrates the stored-program concept on page 86 of Patterson and Hennessy: 1. Instructions are represented as numbers 2. Programs stored in memory to be read & written as "numbers" In the file (whose name is your last name followed by _mp3.s) for MP3, you illustrated the representation of machine language instructions in the text segment. In this assignment, you are to take the same word declarations that you had in the last assignment, and put them (forming a data array) in the data segment of another program. The Babbage program is now going to be read as "numbers. The main program is the assembly language program that is equivalent to the following C++ program (assuming you have twelve hexadecimal values from MP2): long i,p; #define MAXM 13 long m[MAXM] = { hexadecimal values of MIPS instructions from MP2.... 0x1000ffff}; void main() P = 0; i = 0; while (i - 0x1000ffff) 1 i = mp): p - p + 1; cout cout cout

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!