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
Get step-by-step solutions from verified subject matter experts
