.global main, Stop, CodeEnd, DataStart, DataEnd .global head main: // Get the RHS first movw r0, #:lower16:head movt r0, #:upper16:head // r0 = addr(head) ldr r0, [r0] // r0 = head ldr r0, [r0, #8] // r0 = head.next ldr r0, [r0, #8] // r0 = head.next.next ldrsh r0, [r0, #6] // r0 = head.next.next.value3 // Store r0 into LHS movw r1, #:lower16:head movt r1, #:upper16:head // r0 = addr(head) ldr r1, [r1] // r0 = head str r0, [r1, #0] // head.value1 = r0 // = head.next.next.value3 Stop: nop CodeEnd: /* ************************************************************** Permanent variables ************************************************************** */ .data .align 12 DataStart: // list structure is: [int value1, short value2, short value3, next] p0: .4byte 333 // Object [333,23,33,p2] .2byte 23, 33 .4byte p2 .skip 4 // gap p1: .4byte 111 // Object [111,21,31,p3] .2byte 21, 31 .4byte p3 p2: .4byte 444 // Object [444,24,34,p4] .2byte 24, 34 .4byte p4 .skip 4 // gap p3: .4byte 222 // Object [222,22,32,p2] .2byte 22, 32 .4byte p0 .skip 4 // gap p4: .4byte 555 // Object [555,25,35,null] .2byte 25, 35 .4byte 0 head: .word p1 // head contains the address of the first list elem // head->[111,21,31]->[222,22,32]->[333,23,33]-> // ->[444,24,34]->[555,25,35] DataEnd: .end