From 95686b169e9d35c7a5cb37eb07355d2de23c6d9b Mon Sep 17 00:00:00 2001 From: "ol.sc" Date: Thu, 14 Jun 2012 20:44:35 +0000 Subject: [PATCH] Moved actual computation of DOS 3.3 header to linker configurations: - This will allow for different "formulas". - This brings things together in one place. git-svn-id: svn://svn.cc65.org/cc65/trunk@5716 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/apple2/exehdr.s | 10 +++------- src/ld65/cfg/apple2-dos33.cfg | 3 +++ src/ld65/cfg/apple2-loader.cfg | 3 +++ src/ld65/cfg/apple2-reboot.cfg | 3 +++ src/ld65/cfg/apple2-system.cfg | 3 +++ src/ld65/cfg/apple2.cfg | 3 +++ src/ld65/cfg/apple2enh-dos33.cfg | 3 +++ src/ld65/cfg/apple2enh-loader.cfg | 3 +++ src/ld65/cfg/apple2enh-reboot.cfg | 3 +++ src/ld65/cfg/apple2enh-system.cfg | 3 +++ src/ld65/cfg/apple2enh.cfg | 3 +++ 11 files changed, 33 insertions(+), 7 deletions(-) diff --git a/libsrc/apple2/exehdr.s b/libsrc/apple2/exehdr.s index 5ebd6f7f1..f66b14a5c 100644 --- a/libsrc/apple2/exehdr.s +++ b/libsrc/apple2/exehdr.s @@ -6,15 +6,11 @@ ; .export __EXEHDR__ : absolute = 1 ; Linker referenced - .import __RAM_START__, __ZPSAVE_RUN__ ; Linker generated - .import __MOVE_START__, __MOVE_LAST__ ; Linker generated - - .linecont + + .import __LOADADDR__, __LOADSIZE__ ; Linker generated ; ------------------------------------------------------------------------ .segment "EXEHDR" - .addr __RAM_START__ ; Start address - .word __ZPSAVE_RUN__ - __RAM_START__ + \ - __MOVE_LAST__ - __MOVE_START__ ; Size + .addr __LOADADDR__ ; Load address + .word __LOADSIZE__ ; Load length diff --git a/src/ld65/cfg/apple2-dos33.cfg b/src/ld65/cfg/apple2-dos33.cfg index 091406e5c..644b0cc41 100644 --- a/src/ld65/cfg/apple2-dos33.cfg +++ b/src/ld65/cfg/apple2-dos33.cfg @@ -6,6 +6,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2-loader.cfg b/src/ld65/cfg/apple2-loader.cfg index 68556a277..8cf2b43f5 100644 --- a/src/ld65/cfg/apple2-loader.cfg +++ b/src/ld65/cfg/apple2-loader.cfg @@ -6,6 +6,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2-reboot.cfg b/src/ld65/cfg/apple2-reboot.cfg index 82b2ea59b..e10b0debb 100644 --- a/src/ld65/cfg/apple2-reboot.cfg +++ b/src/ld65/cfg/apple2-reboot.cfg @@ -7,6 +7,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2-system.cfg b/src/ld65/cfg/apple2-system.cfg index 187cc7907..51397f096 100644 --- a/src/ld65/cfg/apple2-system.cfg +++ b/src/ld65/cfg/apple2-system.cfg @@ -3,6 +3,9 @@ SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2.cfg b/src/ld65/cfg/apple2.cfg index 00d615644..16f6428ce 100644 --- a/src/ld65/cfg/apple2.cfg +++ b/src/ld65/cfg/apple2.cfg @@ -6,6 +6,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2enh-dos33.cfg b/src/ld65/cfg/apple2enh-dos33.cfg index 091406e5c..644b0cc41 100644 --- a/src/ld65/cfg/apple2enh-dos33.cfg +++ b/src/ld65/cfg/apple2enh-dos33.cfg @@ -6,6 +6,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2enh-loader.cfg b/src/ld65/cfg/apple2enh-loader.cfg index 68556a277..8cf2b43f5 100644 --- a/src/ld65/cfg/apple2enh-loader.cfg +++ b/src/ld65/cfg/apple2enh-loader.cfg @@ -6,6 +6,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2enh-reboot.cfg b/src/ld65/cfg/apple2enh-reboot.cfg index 82b2ea59b..e10b0debb 100644 --- a/src/ld65/cfg/apple2enh-reboot.cfg +++ b/src/ld65/cfg/apple2enh-reboot.cfg @@ -7,6 +7,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2enh-system.cfg b/src/ld65/cfg/apple2enh-system.cfg index 187cc7907..51397f096 100644 --- a/src/ld65/cfg/apple2enh-system.cfg +++ b/src/ld65/cfg/apple2enh-system.cfg @@ -3,6 +3,9 @@ SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; diff --git a/src/ld65/cfg/apple2enh.cfg b/src/ld65/cfg/apple2enh.cfg index 00d615644..16f6428ce 100644 --- a/src/ld65/cfg/apple2enh.cfg +++ b/src/ld65/cfg/apple2enh.cfg @@ -6,6 +6,9 @@ FEATURES { SYMBOLS { __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __LOADADDR__: type = weak, value = __RAM_START__; + __LOADSIZE__: type = weak, value = __ZPSAVE_RUN__ - __RAM_START__ + + __MOVE_LAST__ - __MOVE_START__; } MEMORY { ZP: file = "", define = yes, start = $0080, size = $001A; -- 2.39.5