From 4a9210e3e111e0ed60fac17e5cf047a9f3b4f7a9 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 24 Nov 2002 11:18:24 +0000 Subject: [PATCH] Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@1618 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c64/crt0.s | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libsrc/c64/crt0.s b/libsrc/c64/crt0.s index 92ef5bcf1..70df21d7c 100644 --- a/libsrc/c64/crt0.s +++ b/libsrc/c64/crt0.s @@ -1,4 +1,4 @@ -; +; ; Startup code for cc65 (C64 version) ; ; This must be the *first* file on the linker command line @@ -52,26 +52,27 @@ L1: lda sp,x 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 -- 2.39.5