Question

directly 3- Consider the C++ code below. Translate the code into MIPS instructions as possible. Put them in a file called pro

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

Mips instructions:

main:

push rbp

mov rbp, rsp

mov DWORD PTR [rbp-32], 300

mov DWORD PTR [rbp-28], 200

mov DWORD PTR [rbp-24], 100

mov DWORD PTR [rbp-20], 0

mov DWORD PTR [rbp-4], 3

mov edx, DWORD PTR [rbp-32]

mov eax, DWORD PTR [rbp-28]

add edx, eax

mov eax, DWORD PTR [rbp-24]

add edx, eax

mov eax, DWORD PTR [rbp-4]

cdqe

mov DWORD PTR [rbp-32+rax*4], edx

mov eax, 0

pop rbp

ret

Add a comment
Know the answer?
Add Answer to:
directly 3- Consider the C++ code below. Translate the code into MIPS instructions as possible. Put...
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