/* -------------------------------------------------- Define required labels for EGTAPI -------------------------------------------------- */ .global main, Stop, CodeEnd .global DataStart, DataEnd .global i, s, b // i is int, s is short, b is byte /* -------------------------------------------------- Begin of the program instructions -------------------------------------------------- */ .text main: movw r1, #:lower16:0xAABBCCDD // r1 = AABBCCDD (Hex) movt r1, #:upper16:0xAABBCCDD // Move 4 bytes in r1 to i movw r0, #:lower16:i // Moves the address of memory movt r0, #:upper16:i // variable i into register r0 str r1,[r0] // Move 4 bytes from r1 to var // Move 2 bytes in r1 to s movw r0, #:lower16:s // Moves the address of memory movt r0, #:upper16:s // variable s into register r0 strh r1,[r0] // Move 2 bytes from r1 to var // Move 1 byte in r1 to b movw r0, #:lower16:b // Moves the address of memory movt r0, #:upper16:b // variable b into register r0 strb r1,[r0] // Move 1 byte from r1 to var Stop: CodeEnd: nop /* -------------------------------------------------- Begin of the permanent program variables -------------------------------------------------- */ .data DataStart: i: .4byte 444444 // int typed variable s: .2byte 2222 // short typed variable b: .byte 111 // byte typed variable DataEnd: .end