From: cuz Date: Mon, 30 Oct 2000 21:46:45 +0000 (+0000) Subject: Squeeze 2 bytes out of the startup code X-Git-Tag: V2.12.0~3112 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c436aec1d19b3aa6bbaa90fe9ef5bdda5dd252f;p=cc65 Squeeze 2 bytes out of the startup code git-svn-id: svn://svn.cc65.org/cc65/trunk@414 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/apple2/crt0.s b/libsrc/apple2/crt0.s index c3530ccf6..7cc6cd72f 100644 --- a/libsrc/apple2/crt0.s +++ b/libsrc/apple2/crt0.s @@ -46,10 +46,10 @@ zpspace = * - zpstart ; Zero page space allocated ; ------------------------------------------------------------------------ ; 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 ; Clear the BSS data @@ -89,8 +89,7 @@ L1: lda sp,y ; fall thru to exit... -_exit: - lda #$ff +_exit: lda #$ff sta TEXTTYP jsr doatexit ; call exit functions @@ -100,10 +99,10 @@ _exit: ; 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 diff --git a/libsrc/atari/crt0.s b/libsrc/atari/crt0.s index 8d8ddda31..db0d7ec59 100644 --- a/libsrc/atari/crt0.s +++ b/libsrc/atari/crt0.s @@ -70,10 +70,10 @@ zpspace = * - zpstart ; Zero page space allocated ; Save the zero page locations we need - ldy #zpspace-1 -L1: lda sp,y - sta zpsave,y - dey + ldx #zpspace-1 +L1: lda sp,x + sta zpsave,x + dex bpl L1 ; Clear the BSS data @@ -175,10 +175,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 ; Back to DOS diff --git a/libsrc/pet/crt0.s b/libsrc/pet/crt0.s index 6d1849d87..21bdf0107 100644 --- a/libsrc/pet/crt0.s +++ b/libsrc/pet/crt0.s @@ -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 @@ -109,10 +109,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 ; Back to basic