mirror of
https://github.com/cc65/cc65.git
synced 2024-11-10 10:04:50 +00:00
3b3e1bec17
handled by the OPTIONAL segment attribute in the linker config. git-svn-id: svn://svn.cc65.org/cc65/trunk@2164 b7a2c559-68d2-44c3-8de9-860c34a00d81
46 lines
932 B
ArmAsm
46 lines
932 B
ArmAsm
;
|
|
; This must be the *second* file on the linker command line
|
|
; (.cvt header must be the *first* one)
|
|
|
|
; Maciej 'YTM/Elysium' Witkowiak
|
|
; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
|
|
|
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
|
.import initlib, donelib
|
|
.import callmain
|
|
.import zerobss
|
|
.importzp sp
|
|
.export _exit
|
|
.include "../inc/jumptab.inc"
|
|
|
|
; ------------------------------------------------------------------------
|
|
; Place the startup code in a special segment.
|
|
|
|
.segment "STARTUP"
|
|
|
|
; Clear the BSS data
|
|
|
|
jsr zerobss
|
|
|
|
; Setup stack
|
|
|
|
lda #<(__RAM_START__ + __RAM_SIZE__)
|
|
sta sp
|
|
lda #>(__RAM_START__ + __RAM_SIZE__)
|
|
sta sp+1 ; Set argument stack ptr
|
|
|
|
; Call module constructors
|
|
|
|
jsr initlib
|
|
|
|
; Push arguments and call main()
|
|
|
|
cli
|
|
jsr callmain
|
|
|
|
; Call module destructors.
|
|
|
|
_exit: jsr donelib ; Run module destructors
|
|
|
|
jmp EnterDeskTop ; return control to the system
|