1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 22:30:12 +00:00

Added crt0 to none.lib

This commit is contained in:
bauen1 2018-01-04 12:07:35 +01:00
parent 14909f12fe
commit 98b2b2544d
No known key found for this signature in database
GPG Key ID: FF0AAF5E0812BA9C
2 changed files with 26 additions and 0 deletions

View File

@ -7,6 +7,7 @@ MEMORY {
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
STARTUP: load = MAIN, type = ro, optional = yes;
LOWCODE: load = MAIN, type = ro, optional = yes;
ONCE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = rw;

25
libsrc/none/crt0.s Normal file
View File

@ -0,0 +1,25 @@
.export _exit
.export __STARTUP__ : absolute = 1 ; Mark as startup
.import zerobss, _main
.import initlib, donelib
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated
.include "zeropage.inc"
.segment "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 _main
_exit: pha
jsr donelib
pla
brk