2 ; In the absence of a custom linker script, go with something simple.
3 ; We do not support passing arguments to "main", but this is an embedded
6 ; We call init/fini here without cpu prefixes because there is always
7 ; only one .init/.fini section per image.
15 mov sp,end ; Round "sp" up to page after "end".
19 ld r8,[stack_size] ; Add stack size to "sp".
22 st sp,[sbrk_start] ; Initialize malloc heap.
25 sub sp,sp,16 ; callee expects 16 bytes already "pushed".
26 mov fp,0 ; Top of stack frame indicator.
28 mov r0,edata ; Zero bss.
35 bl.nd init ; .init section entry point.
36 mov r0,%st(fini) ; .fini section entry point.
46 bl.nd init ; .init section entry point.
47 mov r0,%st(fini) ; .fini section entry point.
56 bl.nd _graphics_memset
57 bl.nd init ; .init section entry point.
58 mov r0,%st(fini) ; .fini section entry point.
59 bl.nd _graphics_atexit
68 bl.nd init ; .init section entry point.
69 mov r0,%st(fini) ; .fini section entry point.