Question

What does the ADR instruction do in Arm Architecture. For example: ADR R0, R0, R1 please...

What does the ADR instruction do in Arm Architecture.

For example: ADR R0, R0, R1

please compare the ADR and the LDR instructions, and feel free to use your examples for any of the questions. Thank you very much.

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

ADR is used to produce position independent code . why because assembler generates an instruction that adds or subtracts a value to the PC .

ADR always assembles to one instruction. to assemble wider range of effective addresses use ADRL instruction .

in above example , the instruction  ADR Ro , R1 loads an address into the Ro. in general ADR is replaced by add or sub instruction involving the contents of PC.

LDR(load immediate) obtains immediate data by putting the data in the program code and uses a PC relative load to get the data into register . i.e., it loads register with immediate value .

ADR tries to generate the immediate value by adding or subtracting instructions .

Add a comment
Know the answer?
Add Answer to:
What does the ADR instruction do in Arm Architecture. For example: ADR R0, R0, R1 please...
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