/* -------------------------------------------------- Define required labels for EGTAPI -------------------------------------------------- */ .global main, Stop, CodeEnd, DataStart, DataEnd .global A /* -------------------------------------------------- Begin of the program instructions -------------------------------------------------- */ .text main: mov r0, #111 // Pass 111 as parameter 1 in r0 mov r1, #222 // Pass 222 as parameter 2 in r1 bl f // Calls f(111, 222) // When f returns, you will see the return value in r0 = 999 movw r1, #:lower16:x movt r1, #:upper16:x str r0, [r1] // Assigns: x = f(111,222) Stop: nop /* =============================== Leaf function =============================== */ f: // When run in EGTAPI - you will see r0 = 111 and r1 = 222 nop nop nop mov r0, #999 // Return 999 in R0 mov pc, lr CodeEnd: nop /* -------------------------------------------------- Begin of the permanent program variables -------------------------------------------------- */ .data DataStart: x: .skip 4 DataEnd: .end