From 2959ade6e6c684d9982047bcc2e51717bc4dfee8 Mon Sep 17 00:00:00 2001 From: Greg King Date: Thu, 3 Jan 2019 10:49:56 -0500 Subject: [PATCH] Added, to Plus4 and GEOS linker configure files, the ability to set the start and end addresses of the program region. --- cfg/geos-apple.cfg | 12 ++++++++---- cfg/geos-cbm.cfg | 10 +++++++--- cfg/plus4.cfg | 14 +++++++++----- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/cfg/geos-apple.cfg b/cfg/geos-apple.cfg index 2c9f6c589..98dcfb5aa 100644 --- a/cfg/geos-apple.cfg +++ b/cfg/geos-apple.cfg @@ -1,15 +1,19 @@ +FEATURES { + STARTADDRESS: default = $4000; +} SYMBOLS { __BACKBUFSIZE__: type = weak, value = $2000; + __HIMEM__: type = weak, value = $C000 - __BACKBUFSIZE__; __OVERLAYSIZE__: type = weak, value = $0000; - __OVERLAYADDR__: type = weak, value = $C000 - __BACKBUFSIZE__ - __OVERLAYSIZE__; - __STACKSIZE__: type = weak, value = $0400; + __OVERLAYADDR__: type = weak, value = __HIMEM__ - __OVERLAYSIZE__; + __STACKSIZE__: type = weak, value = $0400; # 1k stack __STACKADDR__: type = weak, value = $2000 - __STACKSIZE__; } MEMORY { CVT: file = %O, start = $0, size = $20000; ZP: define = yes, start = $80, size = $1A + $06; - EXT: define = yes, start = $0C00, size = __STACKADDR__ - $0C00; - VLIR0: define = yes, start = $4000, size = __OVERLAYADDR__ - $4000; + EXT: define = yes, start = $0C00, size = __STACKADDR__ - __EXT_START__; + VLIR0: define = yes, start = %S, size = __OVERLAYADDR__ - %S; VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; diff --git a/cfg/geos-cbm.cfg b/cfg/geos-cbm.cfg index d2e896fa5..4bf33fdf5 100644 --- a/cfg/geos-cbm.cfg +++ b/cfg/geos-cbm.cfg @@ -1,14 +1,18 @@ +FEATURES { + STARTADDRESS: default = $0400; +} SYMBOLS { __BACKBUFSIZE__: type = weak, value = $2000; + __HIMEM__: type = weak, value = $8000 - __BACKBUFSIZE__; __OVERLAYSIZE__: type = weak, value = $0000; - __OVERLAYADDR__: type = weak, value = $8000 - __BACKBUFSIZE__ - __OVERLAYSIZE__; - __STACKSIZE__: type = weak, value = $0400; + __OVERLAYADDR__: type = weak, value = __HIMEM__ - __OVERLAYSIZE__; + __STACKSIZE__: type = weak, value = $0400; # 1k stack __STACKADDR__: type = weak, value = __OVERLAYADDR__ - __STACKSIZE__; } MEMORY { CVT: file = %O, start = $0, size = $40000; ZP: define = yes, start = $58, size = $1A + $06; - VLIR0: define = yes, start = $0400, size = __STACKADDR__ - $0400; + VLIR0: define = yes, start = %S, size = __STACKADDR__ - %S; VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; diff --git a/cfg/plus4.cfg b/cfg/plus4.cfg index 802f1076e..b7199e008 100644 --- a/cfg/plus4.cfg +++ b/cfg/plus4.cfg @@ -1,13 +1,17 @@ +FEATURES { + STARTADDRESS: default = $1001; +} SYMBOLS { __LOADADDR__: type = import; __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack + __HIMEM__: type = weak, value = $FD00; } MEMORY { - ZP: file = "", define = yes, start = $0002, size = $001A; - LOADADDR: file = %O, start = $0FFF, size = $0002; - HEADER: file = %O, start = $1001, size = $000C; - MAIN: file = %O, define = yes, start = $100D, size = $ECF3 - __STACKSIZE__; + ZP: file = "", define = yes, start = $0002, size = $001A; + LOADADDR: file = %O, start = %S - 2, size = $0002; + HEADER: file = %O, define = yes, start = %S, size = $000D; + MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __MAIN_START__ - __STACKSIZE__; } SEGMENTS { ZEROPAGE: load = ZP, type = zp; @@ -15,8 +19,8 @@ SEGMENTS { EXEHDR: load = HEADER, type = ro; STARTUP: load = MAIN, type = ro; LOWCODE: load = MAIN, type = ro, optional = yes; - ONCE: load = MAIN, type = ro, optional = yes; CODE: load = MAIN, type = ro; + ONCE: load = MAIN, type = ro, optional = yes; RODATA: load = MAIN, type = ro; DATA: load = MAIN, type = rw; INIT: load = MAIN, type = bss;