val1
.thumb
.text
.word 1,2,3,4,5,6
val1_ptr .word val1
main:
global main
thumbfunc main
asmfunc
main loop
Use the stack to swap R1 and R2
bx
lr
Load pointer into R0
; Use R0 to load val1[0] into R1
: Use R0 and an offset to load val1[1] into R2
: Put R1 on the stack
Put R2 on the stack
Grab a value off the stack and store into R1
Grab a value off the stack and store into R2
.endasmfunc
.end
Not all instructions, values, and registers are used
r1
r0
r3
r2
val1_ptr
r4
mov ldr push
str
pop