Question

a)Use the lui and addi instructions to store the value of 8000in x6, and then use the addi instruction to calculate the value

ASSEMBLY RISCV

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

LUI will left shift 16 bits and thus will hold higer bytes and ADDI will the remaining 16 bits to the register.

a.

lui x6, 0x0000 # 8000 = 0x00001F40

addi x6, x6, 0x1F40 # loading 8000 in x6

addi x5, x6, 0xFFFFFFF6 # -10 = 0xFFFFFFF6, x5 stores addition of 8000 and -10

b.

lui x6, 0x0000 # 23456 = 0x00005BA0

addi x6, x6, 0x5BA0 # loading 23456 in x6

lui x7, 0x0000 # 12345 = 0x00003039

addi x7, x7, 0x3039 # loading 12345in x6

sub x5, x6, x7 # x5 stores addition of 23456 - 12345

Add a comment
Know the answer?
Add Answer to:
ASSEMBLY RISCV a)Use the lui and addi instructions to store the value of 8000in x6, and then use the addi instruction to calculate the value of 8000-10 and store the result in x5 b) Use the lui an...
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