Question

Trying to figure out how to write expression #2 in assembly language: 1. ;;X=A*C+B*D MUL R4,R0,R2...

Trying to figure out how to write expression #2 in assembly language:

1. ;;X=A*C+B*D

MUL R4,R0,R2

MUL R5,R1,R3

ADDS R4,R4,R5

;;X is in R4

I believe this is correct but Im having trouble with #2 below:

2. Y=A^(B+C)+D

I've been using the arm cortex m4 instruction set for reference.

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

sub sp, sp, #32

ldr w1, [sp, 28]

ldr w0, [sp, 24]

add w1, w1, w0

ldr w0, [sp, 20]

add w0, w1, w0

ldr w1, [sp, 16]

eor w0, w1, w0

str w0, [sp, 12]

nop

add sp, sp, 32

ret

Add a comment
Know the answer?
Add Answer to:
Trying to figure out how to write expression #2 in assembly language: 1. ;;X=A*C+B*D MUL R4,R0,R2...
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