1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00
cc65/libsrc/sim6502/crt0.s

34 lines
913 B
ArmAsm
Raw Normal View History

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