2013-05-20 18:35:42 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 2013-05-16
|
|
|
|
;
|
|
|
|
; Startup code for cc65 (sim6502 version)
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _exit
|
2019-05-29 22:06:31 +00:00
|
|
|
.export startup
|
2013-05-20 18:35:42 +00:00
|
|
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
|
|
|
.import zerobss, callmain
|
|
|
|
.import initlib, donelib
|
|
|
|
.import exit
|
2016-03-07 00:28:55 +00:00
|
|
|
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
|
2013-05-20 18:35:42 +00:00
|
|
|
.import __STACKSIZE__ ; Linker generated
|
|
|
|
|
|
|
|
.include "zeropage.inc"
|
|
|
|
|
|
|
|
.segment "STARTUP"
|
|
|
|
|
2019-05-29 22:06:31 +00:00
|
|
|
startup:cld
|
2013-05-20 18:35:42 +00:00
|
|
|
ldx #$FF
|
|
|
|
txs
|
2016-03-07 00:28:55 +00:00
|
|
|
lda #<(__MAIN_START__ + __MAIN_SIZE__ + __STACKSIZE__)
|
|
|
|
ldx #>(__MAIN_START__ + __MAIN_SIZE__ + __STACKSIZE__)
|
2013-05-20 18:35:42 +00:00
|
|
|
sta sp
|
|
|
|
stx sp+1
|
|
|
|
jsr zerobss
|
|
|
|
jsr initlib
|
|
|
|
jsr callmain
|
|
|
|
_exit: pha
|
|
|
|
jsr donelib
|
|
|
|
pla
|
2013-05-24 16:25:16 +00:00
|
|
|
jmp exit
|