Question: Assembly language programming of the MIPS 1. Exercise 2 Shifting and Adding Initialize the sum in register $8 to zero. Then add 4096 10 to

Assembly language programming of the MIPS

1. Exercise 2 Shifting and Adding

Initialize the sum in register $8 to zero. Then add 409610 to $8 sixteen times. You don't know how to loop, yet, so do this by making 16 copies of the same instruction. The value 409610 is 0x1000.

Next initialize register $9 to 409610. Shift $9 left by the correct number of positions so that registers $8 and $9 contain the same bit pattern.

Finally, initialize aregister $10 to 409610. Add $10 to itself the correct number of times so that it contains the same bit pattern as the other two registers.

2. Exercise 4 Arithmetic Expression

Let register $8 be x and register $9 be y. Write a program to evaluate:

3x - 5y 

Leave the result in register $10. Inspect the register after running the program to check that the program works. Run the program several times, initialize x and y to different values for each run. (use X=1, Y=2)

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!