Question

Assemble the Following AVR instructions into machine code (express your answer in binary). If you...

Assemble the Following AVR instructions into machine code (express your answer in binary). If you find an error, explain why it is an error. (Show steps)

a) mul r5, r16

b) ldi r22, 65

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

a) mul r5,r16

for MUL instruction format would be

1001 11rd dddd rrrr

mul opcode: 1001

and then 11rd = 1100

dddd = destination register = r5 = 0101

but rrrr = r16 which is error it shoul be within r0,r15. So it can't be converted to machine code.  


for LDI instruction format would beb) ldi r22,65

1110 KKKK dddd KKKK

where 1110 - LDI code

and in the instruction r22 is used which 6th register so dddd - 0110

and KKKK - 6 - 0110

and KKKK - 5 - 0101

so machine code would be: 1110 0110 0110 0101

Add a comment
Know the answer?
Add Answer to:
Assemble the Following AVR instructions into machine code (express your answer in binary). If you...
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