Question

Implement the following command as an assembly language. Z=(V-W)(X+Y) Address : $s1 →80000 V→80004 W→80008 X→80012 Y→80016 Z→

0 0
Add a comment Improve this question Transcribed image text
Answer #1

lw $t0, 4($s1) => $t0 <= V (copying value from address 80000+4 = 80004 i.e. V to temporary register t0)

lw $t1, 8($s1) => $t1 <= W (copying value from address 80000+8 = 80008 i.e. W to temporary register t1)

lw $t2, 12($s1) => $t2 <= X (copying value from address 80000+12 = 80012 i.e. X to temporary register t2)

lw $t3, 16($s1) => $t4 <= Y (copying value from address 80000+16 = 80016 i.e. Y to temporary register t3)

sub $t0, $t0, $t1 => $t0 <= V - W (subtracting value of t1 from t0 and storing back result to t0)

add $t2, $t2, $t3 => $t2 <= X + Y (adding value of t2 into t3 and storing back result to t2)

mul $t0, $t0, $t2 => $t0 <= (V - W)(X + Y) (multiplying value of t0 with t2 and storing back result to t0)

sw $t0, 24($s1) => Z <= (V - W)(X + Y)

=> Storing back result to address 80000+24 = 80024 i.e. Z

Add a comment
Know the answer?
Add Answer to:
Implement the following command as an assembly language. Z=(V-W)(X+Y) Address : $s1 →80000 V→80004 W→80008 X→80012...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT