From 78dcb61cb8d59efa93ac8d5cb4fa08598553121a Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Thu, 17 Mar 2016 21:51:20 +0100 Subject: [PATCH] Harmonized asm linker configs. - All segments but CODE are optional and CODE is R/W. Both together allow to "just" write code/data without ever explicitly using a segment. - Symbols are defined for the BSS. This allows to use/implement zerobss. - The ZP memory area isn't artificially limited. --- cfg/apple2-asm.cfg | 2 +- cfg/apple2enh-asm.cfg | 2 +- cfg/atari-asm.cfg | 20 ++++++++++---------- cfg/c64-asm.cfg | 6 +++--- cfg/osic1p-asm.cfg | 12 ++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cfg/apple2-asm.cfg b/cfg/apple2-asm.cfg index 151ba84c4..8e5abefc5 100644 --- a/cfg/apple2-asm.cfg +++ b/cfg/apple2-asm.cfg @@ -12,7 +12,7 @@ MEMORY { SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes; - CODE: load = MAIN, type = rw, optional = yes; + CODE: load = MAIN, type = rw; RODATA: load = MAIN, type = ro, optional = yes; DATA: load = MAIN, type = rw, optional = yes; BSS: load = BSS, type = bss, optional = yes, define = yes; diff --git a/cfg/apple2enh-asm.cfg b/cfg/apple2enh-asm.cfg index 151ba84c4..8e5abefc5 100644 --- a/cfg/apple2enh-asm.cfg +++ b/cfg/apple2enh-asm.cfg @@ -12,7 +12,7 @@ MEMORY { SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes; - CODE: load = MAIN, type = rw, optional = yes; + CODE: load = MAIN, type = rw; RODATA: load = MAIN, type = ro, optional = yes; DATA: load = MAIN, type = rw, optional = yes; BSS: load = BSS, type = bss, optional = yes, define = yes; diff --git a/cfg/atari-asm.cfg b/cfg/atari-asm.cfg index bea547765..6fc1c2caa 100644 --- a/cfg/atari-asm.cfg +++ b/cfg/atari-asm.cfg @@ -3,7 +3,7 @@ FEATURES { } SYMBOLS { __EXEHDR__: type = import; - __AUTOSTART__: type = import; # force inclusion of autostart "trailer" + __AUTOSTART__: type = import; # force inclusion of autostart "trailer" __STARTADDRESS__: type = export, value = %S; } MEMORY { @@ -18,13 +18,13 @@ MEMORY { TRAILER: file = %O, start = $0000, size = $0006; } SEGMENTS { - ZEROPAGE: load = ZP, type = zp, optional = yes; - EXTZP: load = ZP, type = zp, optional = yes; # to enable modules to be able to link to C and assembler programs - EXEHDR: load = HEADER, type = ro, optional = yes; - MAINHDR: load = MAINHDR, type = ro, optional = yes; - CODE: load = MAIN, type = ro, define = yes, optional = yes; - RODATA: load = MAIN, type = ro optional = yes; - DATA: load = MAIN, type = rw optional = yes; - BSS: load = MAIN, type = bss, define = yes, optional = yes; - AUTOSTRT: load = TRAILER, type = ro, optional = yes; + ZEROPAGE: load = ZP, type = zp, optional = yes; + EXTZP: load = ZP, type = zp, optional = yes; # to enable modules to be able to link to C and assembler programs + EXEHDR: load = HEADER, type = ro, optional = yes; + MAINHDR: load = MAINHDR, type = ro, optional = yes; + CODE: load = MAIN, type = rw, define = yes; + RODATA: load = MAIN, type = ro optional = yes; + DATA: load = MAIN, type = rw optional = yes; + BSS: load = MAIN, type = bss, optional = yes, define = yes; + AUTOSTRT: load = TRAILER, type = ro, optional = yes; } diff --git a/cfg/c64-asm.cfg b/cfg/c64-asm.cfg index 25d12ee71..e2dda5362 100644 --- a/cfg/c64-asm.cfg +++ b/cfg/c64-asm.cfg @@ -5,7 +5,7 @@ SYMBOLS { __LOADADDR__: type = import; } MEMORY { - ZP: file = "", start = $0002, size = $001A, define = yes; + ZP: file = "", start = $0002, size = $00FE, define = yes; LOADADDR: file = %O, start = %S - 2, size = $0002; MAIN: file = %O, start = %S, size = $D000 - %S; } @@ -13,8 +13,8 @@ SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; LOADADDR: load = LOADADDR, type = ro; EXEHDR: load = MAIN, type = ro, optional = yes; - CODE: load = MAIN, type = rw, optional = yes; + CODE: load = MAIN, type = rw; RODATA: load = MAIN, type = ro, optional = yes; DATA: load = MAIN, type = rw, optional = yes; - BSS: load = MAIN, type = bss, optional = yes; + BSS: load = MAIN, type = bss, optional = yes, define = yes; } diff --git a/cfg/osic1p-asm.cfg b/cfg/osic1p-asm.cfg index 1cebe4449..a16f248ab 100644 --- a/cfg/osic1p-asm.cfg +++ b/cfg/osic1p-asm.cfg @@ -10,15 +10,15 @@ SYMBOLS { } MEMORY { # for size of ZP, see runtime/zeropage.s and c1p/extzp.s - ZP: file = "", define = yes, start = $0002, size = $001A + $0006; + ZP: file = "", define = yes, start = $0002, size = $00FE; HEAD: file = %O, start = $0000, size = $00B6; - MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S; + MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S; } SEGMENTS { - ZEROPAGE: load = ZP, type = zp; + ZEROPAGE: load = ZP, type = zp, optional = yes; BOOT: load = HEAD, type = ro, optional = yes; CODE: load = MAIN, type = rw; - RODATA: load = MAIN, type = rw; - DATA: load = MAIN, type = rw; - BSS: load = MAIN, type = bss, define = yes; + RODATA: load = MAIN, type = ro, optional = yes; + DATA: load = MAIN, type = rw, optional = yes; + BSS: load = MAIN, type = bss, optional = yes, define = yes; } -- 2.39.5