From: cuz Date: Thu, 3 Jul 2008 19:39:14 +0000 (+0000) Subject: Moved the data that keeps a copy of the used zero page locations in its own X-Git-Tag: V2.12.0~11 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f257b2ee81866cc9e16a5d9826a2b312b287abf9;p=cc65 Moved the data that keeps a copy of the used zero page locations in its own segment to reduce the executable size. git-svn-id: svn://svn.cc65.org/cc65/trunk@3849 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/atari/crt0.s b/libsrc/atari/crt0.s index f930f470c..2f60f2076 100644 --- a/libsrc/atari/crt0.s +++ b/libsrc/atari/crt0.s @@ -174,7 +174,7 @@ initsp: sta sp+1 rts - .data +.segment "ZPSAVE" zpsave: .res zpspace diff --git a/libsrc/atmos/crt0.s b/libsrc/atmos/crt0.s index 4bbebbc74..677dee84e 100644 --- a/libsrc/atmos/crt0.s +++ b/libsrc/atmos/crt0.s @@ -27,7 +27,7 @@ .byte $00 ; $2AF .byte $80 ; $2AE Machine code flag .byte $C7 ; $2AD Autoload flag - .dbyt __BSS_LOAD__ ; $2AB + .dbyt __BSS_LOAD__ ; $2AB .dbyt __RAM_START__ ; $2A9 .byte $00 ; $2A8 .byte $00 ; Zero terminated name @@ -100,7 +100,7 @@ L2: lda zpsave,x ; ------------------------------------------------------------------------ ; Data -.data +.segment "ZPSAVE" zpsave: .res zpspace diff --git a/libsrc/c128/crt0.s b/libsrc/c128/crt0.s index 83ae66c58..83598c127 100644 --- a/libsrc/c128/crt0.s +++ b/libsrc/c128/crt0.s @@ -182,7 +182,8 @@ IRQStub: ; ------------------------------------------------------------------------ ; Data -.data +.segment "ZPSAVE" + zpsave: .res zpspace .bss diff --git a/libsrc/c16/crt0.s b/libsrc/c16/crt0.s index 7f38719f0..1541d7675 100644 --- a/libsrc/c16/crt0.s +++ b/libsrc/c16/crt0.s @@ -102,10 +102,12 @@ L2: lda zpsave,x jmp RESTOR -.data +.segment "ZPSAVE" + zpsave: .res zpspace .bss + spsave: .res 1 diff --git a/libsrc/c64/crt0.s b/libsrc/c64/crt0.s index d79d64bf6..9c6464523 100644 --- a/libsrc/c64/crt0.s +++ b/libsrc/c64/crt0.s @@ -150,9 +150,12 @@ IRQStub: .data -zpsave: .res zpspace IRQInd: jmp $0000 +.segment "ZPSAVE" + +zpsave: .res zpspace + .bss spsave: .res 1 diff --git a/libsrc/pet/crt0.s b/libsrc/pet/crt0.s index faf32924c..89582885e 100644 --- a/libsrc/pet/crt0.s +++ b/libsrc/pet/crt0.s @@ -136,9 +136,12 @@ IRQStub: .data -zpsave: .res zpspace IRQInd: jmp $0000 +.segment "ZPSAVE" + +zpsave: .res zpspace + .bss spsave: .res 1 diff --git a/libsrc/plus4/crt0.s b/libsrc/plus4/crt0.s index 3b7586009..032ad7947 100644 --- a/libsrc/plus4/crt0.s +++ b/libsrc/plus4/crt0.s @@ -147,8 +147,8 @@ IRQ: cld ; Just to be sure bne dobreak ; It's an IRQ and RAM is enabled. If we have handlers, call them. We will use -; a flag here instead of loading __INTERRUPTOR_COUNT__ directly, since the -; condes function is not reentrant. The irqcount flag will be set/reset from +; a flag here instead of loading __INTERRUPTOR_COUNT__ directly, since the +; condes function is not reentrant. The irqcount flag will be set/reset from ; the main code, to avoid races. ldy irqcount @@ -194,13 +194,16 @@ nohandler: ; Data .data -zpsave: .res zpspace ; BRK handling brk_jmp: jmp $0000 spsave: .res 1 +.segment "ZPSAVE" + +zpsave: .res zpspace + .bss irqcount: .byte 0 diff --git a/libsrc/vic20/crt0.s b/libsrc/vic20/crt0.s index 5864382bb..a0f61c06a 100644 --- a/libsrc/vic20/crt0.s +++ b/libsrc/vic20/crt0.s @@ -142,9 +142,12 @@ IRQStub: .data -zpsave: .res zpspace IRQInd: jmp $0000 +.segment "ZPSAVE" + +zpsave: .res zpspace + .bss spsave: .res 1 diff --git a/src/ld65/cfg/atari.cfg b/src/ld65/cfg/atari.cfg index f311f4de1..f6b0eb675 100644 --- a/src/ld65/cfg/atari.cfg +++ b/src/ld65/cfg/atari.cfg @@ -18,6 +18,7 @@ SEGMENTS { CODE: load = RAM, type = ro, define = yes; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/atmos.cfg b/src/ld65/cfg/atmos.cfg index 15ef471d5..5ab8702dd 100644 --- a/src/ld65/cfg/atmos.cfg +++ b/src/ld65/cfg/atmos.cfg @@ -11,6 +11,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/c128.cfg b/src/ld65/cfg/c128.cfg index 295c0b1c5..e659300b3 100644 --- a/src/ld65/cfg/c128.cfg +++ b/src/ld65/cfg/c128.cfg @@ -9,6 +9,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/c16.cfg b/src/ld65/cfg/c16.cfg index 0f1b35d5b..9f77f6a83 100644 --- a/src/ld65/cfg/c16.cfg +++ b/src/ld65/cfg/c16.cfg @@ -9,6 +9,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/c64.cfg b/src/ld65/cfg/c64.cfg index 2ed1ede15..1e8983ffd 100644 --- a/src/ld65/cfg/c64.cfg +++ b/src/ld65/cfg/c64.cfg @@ -9,6 +9,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/pet.cfg b/src/ld65/cfg/pet.cfg index 45727dcba..2c4ab0b4d 100644 --- a/src/ld65/cfg/pet.cfg +++ b/src/ld65/cfg/pet.cfg @@ -9,6 +9,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/plus4.cfg b/src/ld65/cfg/plus4.cfg index 9c434b714..607185e61 100644 --- a/src/ld65/cfg/plus4.cfg +++ b/src/ld65/cfg/plus4.cfg @@ -9,6 +9,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp; diff --git a/src/ld65/cfg/vic20.cfg b/src/ld65/cfg/vic20.cfg index a31f936b9..1afac90cd 100644 --- a/src/ld65/cfg/vic20.cfg +++ b/src/ld65/cfg/vic20.cfg @@ -9,6 +9,7 @@ SEGMENTS { CODE: load = RAM, type = ro; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; + ZPSAVE: load = RAM, type = bss; BSS: load = RAM, type = bss, define = yes; HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack ZEROPAGE: load = ZP, type = zp;