Arm/loaddecl2

From ASMBits

Consider the assembly code snippet below:

ldr r0, =Data
ldr r1, [r0]
add r0, r0, r1
ldr r1, [r0]
add r0, r0, r1
ldr r2, [r0]


Declare some data in memory such that the result of running the code is:

  • r2 = 0x1234


Sample Input

[None]

Sample Output

r2=0x1234

Write your solution here

x
 
1
// Declare something
2
.data
3
4
5
.text
6
.global _start
7
_start:
8
    ldr r0, =Data
9
    ldr r1, [r0]
10
    add r0, r0, r1
11
    ldr r1, [r0]
12
    add r0, r0, r1
13
    ldr r2, [r0]
14
    1: b 1b    // Done
15
    
16
    
Upload a source file...