Question

LOAD-STORE PROGRAM EXAMPLE Write an Assembly program to add two 8-bit numbers. C A+B lds r16, A lds rl7, B : 1. Load variable

Please answer the list questions above with explanation. Thank you

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

1) First data transfer instruction is load instruction on line 1.

It has a syntax load destination, source.

For the given instruction lds r16,A,

source operand is A

destination operand is r16

operation is load operation

2)The arithmetic and logical instruction is add operation.

It has a syntax add destination, source.

add r16,r17

source operand is r17

destination operand is r16

operation is add operation : r17 to r16 and store in r16

3) In the first instruction, load uses direct addressing mode to load contents of A in register r16.

4)mnemonic is short 3 alphabet term used for instructions to denote a particular instruction

Operation Mnemonic Source Operand Destination Operand Description
Load LDS A r16 loads contents of A to r16
Load LDS B r17 loads contents of B to r17
Add ADD r17 r16 r16 = r16 + r17
Store sts r16 C Stores value in register r16 to C

5)

Memory Data
0100 A
0101 B
0102 C

6) Since r16 is modified to store the result, the question asks to use another register to store it. Use r15 to copy contents of r16 to it, use mov instruction for data transfer.  And use r15 in all the instructions further to add the two numbers.

lds r16, A

lds r17, B

mov r15,r16

add r15,r17

sts C, r15

Add a comment
Know the answer?
Add Answer to:
Please answer the list questions above with explanation. Thank you LOAD-STORE PROGRAM EXAMPLE Write an Assembly...
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