-;
+;
; Startup code for cc65 (C64 version)
;
; This must be the *first* file on the linker command line
lda #14
jsr BSOUT
-; Clear the BSS data
-
- jsr zerobss
-
; Save system stuff and setup the stack
- tsx
- stx spsave ; Save the system stack ptr
-
lda $01
- sta mmusave ; Save the memory configuration
+ tax ; Remember in X
and #$F8
ora #$06 ; Enable kernal+I/O, disable basic
sta $01
+ stx mmusave ; Save the memory configuration
+
+ tsx
+ stx spsave ; Save the system stack ptr
lda #<(__RAM_START__ + __RAM_SIZE__)
sta sp
lda #>(__RAM_START__ + __RAM_SIZE__)
sta sp+1 ; Set argument stack ptr
+; Clear the BSS data
+
+ jsr zerobss
+
; Call module constructors
jsr initlib