]> git.sur5r.net Git - cc65/commitdiff
Move zpsave into its own segment to decrease the executable size.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 15 Jul 2008 18:34:20 +0000 (18:34 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 15 Jul 2008 18:34:20 +0000 (18:34 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3852 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/crt0.s
src/ld65/cfg/apple2.cfg

index bc3771832b1bdb06fb692cd2684ce77d160faec4..ec61770bc23609c4a8309879d3ccbcf09517de45 100644 (file)
@@ -11,7 +11,7 @@
         .import                __RAM_START__ , __RAM_LAST__    ; Linker generated
         .import         __MOVE_START__, __MOVE_LAST__  ; Linker generated
         .import         __LC_START__  , __LC_LAST__    ; Linker generated
-        .import                __BSS_RUN__   , __INIT_SIZE__   ; Linker generated
+        .import                __ZPSAVE_RUN__, __INIT_SIZE__   ; Linker generated
         .import                __INTERRUPTOR_COUNT__           ; Linker generated
 
         .include        "zeropage.inc"
@@ -24,8 +24,8 @@
         .segment        "EXEHDR"
 
         .addr           __RAM_START__                  ; Start address
-        .word           __BSS_RUN__   - __RAM_START__ + \
-                       __MOVE_LAST__ - __MOVE_START__  ; Size
+        .word           __ZPSAVE_RUN__ - __RAM_START__ + \
+                       __MOVE_LAST__  - __MOVE_START__ ; Size
 
 ; ------------------------------------------------------------------------
 
        bit     $C081
        
        ; Set source start address
-       lda     #<(__BSS_RUN__ + __INIT_SIZE__)
-       ldy     #>(__BSS_RUN__ + __INIT_SIZE__)
+       lda     #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
+       ldy     #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
        sta     $9B
        sty     $9C
        
        ; Set source last address
-       lda     #<(__BSS_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
-       ldy     #>(__BSS_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
+       lda     #<(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
+       ldy     #>(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
        sta     $96
        sty     $97
 
        jsr     $D396           ; BLTU + 3
 
        ; Set source start address
-       lda     #<__BSS_RUN__
-       ldy     #>__BSS_RUN__
+       lda     #<__ZPSAVE_RUN__
+       ldy     #>__ZPSAVE_RUN__
        sta     $9B
        sty     $9C
        
        ; Set source last address
-       lda     #<(__BSS_RUN__ + __INIT_SIZE__)
-       ldy     #>(__BSS_RUN__ + __INIT_SIZE__)
+       lda     #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
+       ldy     #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
        sta     $96
        sty     $97
 
@@ -253,12 +253,16 @@ reset:  stx     SOFTEV
 
         .data
 
-zpsave: .res    zpspace
-
 params: .byte   $02            ; Parameter count
 intnum: .byte   $00            ; Interrupt number
         .addr   intrpt         ; Interrupt handler
 
+; ------------------------------------------------------------------------
+
+        .segment        "ZPSAVE"
+
+zpsave: .res    zpspace
+
 ; ------------------------------------------------------------------------
 
         .bss
index 9ef6f3271cafc7e0ee3c624a098025e81a2c8c77..c4168cb952a9a70b3c665d7a0dc3f51425d99187 100644 (file)
@@ -16,6 +16,7 @@ SEGMENTS {
     CODE:     load = RAM,             type = ro;
     RODATA:   load = RAM,             type = ro;
     DATA:     load = RAM,             type = rw;
+    ZPSAVE:   load = RAM,             type = bss, define   = yes;
     BSS:      load = RAM,             type = bss, define   = yes;
     INIT:     load = MOVE, run = RAM, type = ro,  define   = yes;
     HIGHCODE: load = MOVE, run = LC,  type = ro,  optional = yes;