Question: W=X+Y+Z Assignment: Write a TOY assembly language program to add the values of 3 variables, X, Y, and Z, in memory and store the sum

W=X+Y+Z

Assignment: Write a TOY assembly language program to add the values of 3 variables, X, Y, and Z, in memory and store the sum in a fourth, W.

Details: The variables occupy consecutive words of memory starting with W. The address of W is in register $3. Register $4 contains the constant 1. Do not change the values in registers $0 through $4. You can use registers $5 through $F as you please. Your program should consist entirely of addition (add), load (l), and store (st) instructions.

Hint: You will need to construct the addresses of variables X, Y, and Z in a register or in registers. There are various ways to accomplish this.

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!