Move zpsave into its own segment to decrease the executable size.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3852 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2008-07-15 18:34:20 +00:00
parent e64672acc7
commit 258a8e7d4c
2 changed files with 18 additions and 13 deletions

View File

@@ -11,7 +11,7 @@
.import __RAM_START__ , __RAM_LAST__ ; Linker generated .import __RAM_START__ , __RAM_LAST__ ; Linker generated
.import __MOVE_START__, __MOVE_LAST__ ; Linker generated .import __MOVE_START__, __MOVE_LAST__ ; Linker generated
.import __LC_START__ , __LC_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 .import __INTERRUPTOR_COUNT__ ; Linker generated
.include "zeropage.inc" .include "zeropage.inc"
@@ -24,7 +24,7 @@
.segment "EXEHDR" .segment "EXEHDR"
.addr __RAM_START__ ; Start address .addr __RAM_START__ ; Start address
.word __BSS_RUN__ - __RAM_START__ + \ .word __ZPSAVE_RUN__ - __RAM_START__ + \
__MOVE_LAST__ - __MOVE_START__ ; Size __MOVE_LAST__ - __MOVE_START__ ; Size
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
@@ -42,14 +42,14 @@
bit $C081 bit $C081
; Set source start address ; Set source start address
lda #<(__BSS_RUN__ + __INIT_SIZE__) lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
ldy #>(__BSS_RUN__ + __INIT_SIZE__) ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
sta $9B sta $9B
sty $9C sty $9C
; Set source last address ; Set source last address
lda #<(__BSS_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__) lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
ldy #>(__BSS_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__) ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
sta $96 sta $96
sty $97 sty $97
@@ -64,14 +64,14 @@
jsr $D396 ; BLTU + 3 jsr $D396 ; BLTU + 3
; Set source start address ; Set source start address
lda #<__BSS_RUN__ lda #<__ZPSAVE_RUN__
ldy #>__BSS_RUN__ ldy #>__ZPSAVE_RUN__
sta $9B sta $9B
sty $9C sty $9C
; Set source last address ; Set source last address
lda #<(__BSS_RUN__ + __INIT_SIZE__) lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
ldy #>(__BSS_RUN__ + __INIT_SIZE__) ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
sta $96 sta $96
sty $97 sty $97
@@ -253,12 +253,16 @@ reset: stx SOFTEV
.data .data
zpsave: .res zpspace
params: .byte $02 ; Parameter count params: .byte $02 ; Parameter count
intnum: .byte $00 ; Interrupt number intnum: .byte $00 ; Interrupt number
.addr intrpt ; Interrupt handler .addr intrpt ; Interrupt handler
; ------------------------------------------------------------------------
.segment "ZPSAVE"
zpsave: .res zpspace
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
.bss .bss

View File

@@ -16,6 +16,7 @@ SEGMENTS {
CODE: load = RAM, type = ro; CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro; RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw; DATA: load = RAM, type = rw;
ZPSAVE: load = RAM, type = bss, define = yes;
BSS: load = RAM, type = bss, define = yes; BSS: load = RAM, type = bss, define = yes;
INIT: load = MOVE, run = RAM, type = ro, define = yes; INIT: load = MOVE, run = RAM, type = ro, define = yes;
HIGHCODE: load = MOVE, run = LC, type = ro, optional = yes; HIGHCODE: load = MOVE, run = LC, type = ro, optional = yes;