From 610bb14988ccb389ae001d420006730a2ff353a9 Mon Sep 17 00:00:00 2001
From: "ol.sc"
Date: Sat, 16 Jun 2012 22:13:58 +0000
Subject: [PATCH] Avoid mixing of memory areas and segments in address
computations (and made move of segment INIT somewhat more readable).
git-svn-id: svn://svn.cc65.org/cc65/trunk@5726 b7a2c559-68d2-44c3-8de9-860c34a00d81
---
libsrc/apple2/crt0.s | 8 ++++----
src/ld65/cfg/apple2-loader.cfg | 8 ++++----
src/ld65/cfg/apple2-system.cfg | 8 ++++----
src/ld65/cfg/apple2.cfg | 8 ++++----
src/ld65/cfg/apple2enh-loader.cfg | 8 ++++----
src/ld65/cfg/apple2enh-system.cfg | 8 ++++----
src/ld65/cfg/apple2enh.cfg | 8 ++++----
7 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/libsrc/apple2/crt0.s b/libsrc/apple2/crt0.s
index 9bc8ac68b..ba4e0dcf1 100644
--- a/libsrc/apple2/crt0.s
+++ b/libsrc/apple2/crt0.s
@@ -9,9 +9,9 @@
.import zerobss
.import initlib, donelib
.import callmain, callirq
- .import __RAM_LAST__, __ZPSAVE_RUN__ ; Linker generated
.import __LC_START__, __LC_LAST__ ; Linker generated
- .import __INIT_SIZE__ ; Linker generated
+ .import __INIT_RUN__, __INIT_SIZE__ ; Linker generated
+ .import __ZPSAVE_RUN__ ; Linker generated
.import __INTERRUPTOR_COUNT__ ; Linker generated
.include "zeropage.inc"
@@ -66,8 +66,8 @@
sty $97
; Set destination last address
- lda #<__RAM_LAST__
- ldy #>__RAM_LAST__
+ lda #<(__INIT_RUN__ + __INIT_SIZE__)
+ ldy #>(__INIT_RUN__ + __INIT_SIZE__)
sta $94
sty $95
diff --git a/src/ld65/cfg/apple2-loader.cfg b/src/ld65/cfg/apple2-loader.cfg
index 6b5f50f43..e8b81adcb 100644
--- a/src/ld65/cfg/apple2-loader.cfg
+++ b/src/ld65/cfg/apple2-loader.cfg
@@ -8,21 +8,21 @@ SYMBOLS {
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
__STACKSIZE__: type = weak, value = $0800; # 2k stack
- __LOADADDR__: type = weak, value = __RAM_START__;
- __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ +
+ __LOADADDR__: type = weak, value = __STARTUP_RUN__;
+ __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
__MOVE_LAST__ - __MOVE_START__;
}
MEMORY {
ZP: define = yes, start = $0080, size = $001A;
HEADER: file = %O, start = $0000, size = $0004;
- RAM: file = %O, define = yes, start = %S, size = $BF00 - __STACKSIZE__ - %S;
+ RAM: file = %O, start = %S, size = $BF00 - __STACKSIZE__ - %S;
MOVE: file = %O, define = yes, start = $0000, size = $FFFF;
LC: define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXEHDR: load = HEADER, type = ro;
- STARTUP: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
diff --git a/src/ld65/cfg/apple2-system.cfg b/src/ld65/cfg/apple2-system.cfg
index abe38d8b6..34fc3e85a 100644
--- a/src/ld65/cfg/apple2-system.cfg
+++ b/src/ld65/cfg/apple2-system.cfg
@@ -4,19 +4,19 @@ SYMBOLS {
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
__STACKSIZE__: type = weak, value = $0800; # 2k stack
- __LOADADDR__: type = weak, value = __RAM_START__;
- __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ +
+ __LOADADDR__: type = weak, value = __STARTUP_RUN__;
+ __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
__MOVE_LAST__ - __MOVE_START__;
}
MEMORY {
ZP: define = yes, start = $0080, size = $001A;
- RAM: file = %O, define = yes, start = $2000, size = $9F00 - __STACKSIZE__;
+ RAM: file = %O, start = $2000, size = $9F00 - __STACKSIZE__;
MOVE: file = %O, define = yes, start = $0000, size = $FFFF;
LC: define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- STARTUP: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
diff --git a/src/ld65/cfg/apple2.cfg b/src/ld65/cfg/apple2.cfg
index 55119e639..379fbcf40 100644
--- a/src/ld65/cfg/apple2.cfg
+++ b/src/ld65/cfg/apple2.cfg
@@ -8,21 +8,21 @@ SYMBOLS {
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
__STACKSIZE__: type = weak, value = $0800; # 2k stack
- __LOADADDR__: type = weak, value = __RAM_START__;
- __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ +
+ __LOADADDR__: type = weak, value = __STARTUP_RUN__;
+ __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
__MOVE_LAST__ - __MOVE_START__;
}
MEMORY {
ZP: define = yes, start = $0080, size = $001A;
HEADER: file = %O, start = $0000, size = $0004;
- RAM: file = %O, define = yes, start = %S, size = $9600 - __STACKSIZE__ - %S;
+ RAM: file = %O, start = %S, size = $9600 - __STACKSIZE__ - %S;
MOVE: file = %O, define = yes, start = $0000, size = $FFFF;
LC: define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXEHDR: load = HEADER, type = ro;
- STARTUP: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
diff --git a/src/ld65/cfg/apple2enh-loader.cfg b/src/ld65/cfg/apple2enh-loader.cfg
index 6b5f50f43..e8b81adcb 100644
--- a/src/ld65/cfg/apple2enh-loader.cfg
+++ b/src/ld65/cfg/apple2enh-loader.cfg
@@ -8,21 +8,21 @@ SYMBOLS {
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
__STACKSIZE__: type = weak, value = $0800; # 2k stack
- __LOADADDR__: type = weak, value = __RAM_START__;
- __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ +
+ __LOADADDR__: type = weak, value = __STARTUP_RUN__;
+ __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
__MOVE_LAST__ - __MOVE_START__;
}
MEMORY {
ZP: define = yes, start = $0080, size = $001A;
HEADER: file = %O, start = $0000, size = $0004;
- RAM: file = %O, define = yes, start = %S, size = $BF00 - __STACKSIZE__ - %S;
+ RAM: file = %O, start = %S, size = $BF00 - __STACKSIZE__ - %S;
MOVE: file = %O, define = yes, start = $0000, size = $FFFF;
LC: define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXEHDR: load = HEADER, type = ro;
- STARTUP: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
diff --git a/src/ld65/cfg/apple2enh-system.cfg b/src/ld65/cfg/apple2enh-system.cfg
index abe38d8b6..34fc3e85a 100644
--- a/src/ld65/cfg/apple2enh-system.cfg
+++ b/src/ld65/cfg/apple2enh-system.cfg
@@ -4,19 +4,19 @@ SYMBOLS {
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
__STACKSIZE__: type = weak, value = $0800; # 2k stack
- __LOADADDR__: type = weak, value = __RAM_START__;
- __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ +
+ __LOADADDR__: type = weak, value = __STARTUP_RUN__;
+ __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
__MOVE_LAST__ - __MOVE_START__;
}
MEMORY {
ZP: define = yes, start = $0080, size = $001A;
- RAM: file = %O, define = yes, start = $2000, size = $9F00 - __STACKSIZE__;
+ RAM: file = %O, start = $2000, size = $9F00 - __STACKSIZE__;
MOVE: file = %O, define = yes, start = $0000, size = $FFFF;
LC: define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- STARTUP: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
diff --git a/src/ld65/cfg/apple2enh.cfg b/src/ld65/cfg/apple2enh.cfg
index 55119e639..379fbcf40 100644
--- a/src/ld65/cfg/apple2enh.cfg
+++ b/src/ld65/cfg/apple2enh.cfg
@@ -8,21 +8,21 @@ SYMBOLS {
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
__STACKSIZE__: type = weak, value = $0800; # 2k stack
- __LOADADDR__: type = weak, value = __RAM_START__;
- __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ +
+ __LOADADDR__: type = weak, value = __STARTUP_RUN__;
+ __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
__MOVE_LAST__ - __MOVE_START__;
}
MEMORY {
ZP: define = yes, start = $0080, size = $001A;
HEADER: file = %O, start = $0000, size = $0004;
- RAM: file = %O, define = yes, start = %S, size = $9600 - __STACKSIZE__ - %S;
+ RAM: file = %O, start = %S, size = $9600 - __STACKSIZE__ - %S;
MOVE: file = %O, define = yes, start = $0000, size = $FFFF;
LC: define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXEHDR: load = HEADER, type = ro;
- STARTUP: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
--
2.39.5