/* -------------------------------------------------- Define required labels for EGTAPI -------------------------------------------------- */ .global main, Stop, CodeEnd .global DataStart, DataEnd .global A, B, C /* -------------------------------------------------- Access A[3] (byte), B[3] (short) and C[3] (int) -------------------------------------------------- */ .text main: // ============================================================ A[3] movw r0, #:lower16:A movt r0, #:upper16:A // r0 = base address of array A // Address of A[3] = base addr + 3*1 ldrsb r2, [r0, #3] // Load A[3] into r2 // ============================================================ B[3] movw r0, #:lower16:B movt r0, #:upper16:B // r0 = base address of array B // Address of B[3] = base addr + 3*2 ldrsh r3, [r0, #6] // Load B[3] into r3 // ============================================================ C[3] movw r0, #:lower16:C movt r0, #:upper16:C // r0 = base address of array C // Address of C[3] = base addr + 3*4 ldr r4, [r0, #12] // Load C[3] into r4 Stop: CodeEnd: nop /* -------------------------------------------------- Begin of the permanent program variables -------------------------------------------------- */ .data DataStart: A: .byte 11, 12, 13, 14, 15 // byte typed initialzied array A .align 1 B: .2byte 111, 112, 113, 114, 115 // short typed initialzied array B .align 2 C: .4byte 1111, 1112, 1113, 1114, 1115 // int typed initialzied array C DataEnd: .end