Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EXAMPLE 6.4 Let's examine another example, this time to see how the ADR pseudo-instruction actually gets converted into real ARM instructions. Again, the code in

image text in transcribedimage text in transcribed

EXAMPLE 6.4 Let's examine another example, this time to see how the ADR pseudo-instruction actually gets converted into real ARM instructions. Again, the code in this exam- ple doesn't actually do anything except set up pointers, but it will serve to illustrate how ADR behaves. AREA ENTRY adrlabel, CODE, READONLY mark first instruction to execute func stop Start BL stop LTORG fune ADR ADR ADR r0, Start r1, Datarea 12, DataArea + 4300 branch to subroutine ; terminate ; create a literal pool => SUB TO, PC, #offset to Start => ADD r1, PC, #offset to DataArea This would fail because the offset cannot be expressed by operand2 of ADD => ADD r2, PC, #offset1 ADD r2, r2, #offset2 ; return ADRL 12, DataArea +4300 lr BX DataArea SPACE B000 ; starting at the current location, ; clears an 8000-byte area of memory to O END Refer to Example 6.4, page 114. Replace the instruction ADR r0, Start with ADRL 10, Start. What instructions will be substituted for this instruction by the assembler? Compute the required offsets

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions