; Startup code for ADS 1.2 by nanjungho
; User must set link option -first crt0.o(init)
;////////////////////////////////////////////////////////////////////////////@
;// crt0.S /@
;////////////////////////////////////////////////////////////////////////////@
AREA init, CODE, READONLY
IMPORT |Image$$RO$$Base| ; Base of ROM code
IMPORT |Image$$RO$$Limit| ; End of ROM code (=start of ROM data)
IMPORT |Image$$RW$$Base| ; Base of RAM to initialize
IMPORT |Image$$RW$$Limit| ; End of ROM code (=start of ROM data)
IMPORT |Image$$ZI$$Base| ; Base and limit of area
IMPORT |Image$$ZI$$Limit| ; to zero initialize
IMPORT __rt_lib_init
IMPORT gpmain
; HEADER
ENTRY
B _START
DCD |Image$$RO$$Base|; ?
DCD |Image$$RO$$Limit|; End of ROM code (=start of ROM data)
DCD |Image$$RW$$Base|; Base of RAM to initialize
DCD |Image$$RW$$Limit|; ?
DCD |Image$$ZI$$Base|; Base and limit of area
DCD |Image$$ZI$$Limit|;
DCD 0x44450011
DCD 0x44450011
_HEAPSTART
DCD |Image$$ZI$$Limit| ; start of Heap area
_HEAPEND
DCD 0x0C700000 ; end of Heap area
_STACKSTART
DCD 0x0C77FF00 ; same as geepee32(emulator)
_START
; Set up stdlib.
LDR r1, _HEAPEND
LDR r0, _HEAPSTART
BL __rt_lib_init
LDR r13, _STACKSTART; sp setup
ldr r3, =gpmain; C/C++ main Entry Function(do not rename to main)
bx r3
END