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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started