/* -------------------------------------------------- Define required labels for EGTAPI -------------------------------------------------- */ .global main, Stop, CodeEnd .global DataStart, DataEnd .global A, B, C /* ------------------------------------------------------- Store 222 into A[3] (byte), B[3] (short) and C[3] (int) ------------------------------------------------------- */ .text main: mov r1, #44 // Value to be stored // ============================================================ A[3] movw r0, #:lower16:A movt r0, #:upper16:A // r0 = base address of array A // Address of A[3] = base addr + 3*1 strb r1, [r0, #3] // Store r1 into A[3] (byte) // ============================================================ B[3] movw r0, #:lower16:B movt r0, #:upper16:B // r0 = base address of array B // Address of B[3] = base addr + 3*2 strh r1, [r0, #6] // Store r1 into B[3] (short) // ============================================================ C[3] movw r0, #:lower16:C movt r0, #:upper16:C // r0 = base address of array C // Address of C[3] = base addr + 3*4 str r1, [r0, #12] // Store r1 into C[3] (int) 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