Question: For the following MIPS programming exercise, you may use only these instructions or macros: add addi addiu addu and andi div divu li lui lw
For the following MIPS programming exercise, you may use only these instructions or macros:
add addi addiu addu and andi div divu li lui lw mfhi mflo mult multu nor or ori sll sra srl sub subu sw xor xori
Evaluate the expression: 18xy + 12x - 6y + 12 Use symbolic addresses for x, y, and the answer. Assume that the values are small enough so that all results fit into 32 bits. Since load delays are turned on in SPIM be careful what instructions are placed in the delay slots. Verify that the program works by using several initial values for x and y. Use x=0, y=1 and x=1, y=0 to start since this will make debugging easy. Then try some other values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
