Question

convert the following C codes into assembly language var1=5;(32-bits) // assume signed numbers r1=var1 if (r1>0)...

convert the following C codes into assembly language


var1=5;(32-bits)
// assume signed numbers
r1=var1
if (r1>0) {
r3++; //r3=r3+1
}


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

let var1,r1,r3 are at $t0,$t1,$t2,$t3 respectively.

li $t0,5

mov $t1,$t2

blez $t1,$zero exit

addi $t3, $t3,1

exit:

*****************************************************************************
PLEASE DO UPVOTE IF THE ANSWER IS HELPFUL AS IT GIVES THE CONFIDENCE TO HELP MORE STUDENTS
*****************************************************************************
Chegg allows me to answer specific no of questions including the sub parts , so please do post the rest of the questions as a separate query as per Chegg Guidelines. Thank you :)
*****************************************************************************

Add a comment
Know the answer?
Add Answer to:
convert the following C codes into assembly language var1=5;(32-bits) // assume signed numbers r1=var1 if (r1>0)...
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