Question

[8 pts] We want to create the multiplication operation, using the ARM LEGv8 operations we already know (without using the MUL

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

ARM64 GCC 8.2 code:

main:

sub sp, sp, #16

str wzr, [sp, 12]

mov w0, 5

str w0, [sp, 4]

str wzr, [sp, 8]

.L3:

ldr w1, [sp, 8]

ldr w0, [sp]

cmp w1, w0

bge .L2

ldr w1, [sp, 12]

ldr w0, [sp, 4]

add w0, w1, w0

str w0, [sp, 12]

ldr w0, [sp, 8]

add w0, w0, 1

str w0, [sp, 8]

b .L3

.L2:

mov w0, 0

add sp, sp, 16

ret

if you like the answer please provide a thumbs up.

Add a comment
Know the answer?
Add Answer to:
[8 pts] We want to create the multiplication operation, using the ARM LEGv8 operations we already...
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
  • 1 L, as a dynamical system (Notes from Assignment #2) We take our definition of dynamical system ...

    1 L, as a dynamical system (Notes from Assignment #2) We take our definition of dynamical system to be an "object" along with a specific set of modifications that can be performed (dynamically) upon this object. In this case, the object is a bi-infinite straight road with a lamp post at every street corner and a marked lamp (the position of the lamplighter). There are two possible types of modifications: the lamplighter can walk any distance in either direction from...

  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

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