]> git.sur5r.net Git - cc65/commitdiff
Squeeze 4 bytes out of the startup code
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 30 Oct 2000 21:01:34 +0000 (21:01 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 30 Oct 2000 21:01:34 +0000 (21:01 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@412 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/c64/crt0.s

index 1c5f3f97e9522a730accf9f047fb48739a460d42..885775414374210dedb822f878aef657760b0e8d 100644 (file)
@@ -54,10 +54,10 @@ Head:   .word   @Next
 ; ------------------------------------------------------------------------
 ; Actual code
 
-       ldy     #zpspace-1
-L1:    lda     sp,y
-       sta     zpsave,y        ; Save the zero page locations we need
-       dey
+       ldx     #zpspace-1
+L1:    lda     sp,x
+       sta     zpsave,x        ; Save the zero page locations we need
+       dex
                bpl     L1
 
 ; Close open files
@@ -80,7 +80,6 @@ L1:   lda     sp,y
 
        lda     $01
        sta     mmusave         ; Save the memory configuration
-       lda     $01
        and     #$F8
                ora     #$06            ; Enable kernal+I/O, disable basic
        sta     $01
@@ -117,10 +116,10 @@ _exit:    jsr     doatexit        ; call exit functions
 
 ; Copy back the zero page stuff
 
-       ldy     #zpspace-1
-L2:    lda     zpsave,y
-       sta     sp,y
-       dey
+               ldx     #zpspace-1
+L2:    lda     zpsave,x
+       sta     sp,x
+       dex
                bpl     L2
 
 ; Reset changed vectors, back to basic