1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Apple GEOS reserves beside the main app area at $4000-$C000 a secondary app area at $0C00-$2000. While it was an elegant idea to use that secondary area for overlays at the end of the day those 5 kB are just too small. So now overlays go at the end of the main area (as with GEOS 64/128).

However the stack (usually 1 kB) can be securely placed in the secondary area without effort from the side of the developer. The rest of the secondary area (usually 4 kB) is made available to the developer as (uninitialized) 'EXTBSS'.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5696 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc 2012-06-08 21:46:51 +00:00
parent 5cf9f585a6
commit ffc06fcea3
4 changed files with 15 additions and 13 deletions

View File

@ -6,8 +6,8 @@
.export _exit
.export __STARTUP__ : absolute = 1 ; Mark as startup
.import __VLIR0_START__, __VLIR0_SIZE__ ; Linker generated
.import __STACKSIZE__, __BACKBUFSIZE__ ; Linker generated
.import __STACKADDR__, __STACKSIZE__ ; Linker generated
.import __BACKBUFSIZE__ ; Linker generated
.import initlib, donelib
.import callmain
.import zerobss
@ -46,8 +46,8 @@
; Setup stack.
lda #<(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__)
ldx #>(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__)
lda #<(__STACKADDR__ + __STACKSIZE__)
ldx #>(__STACKADDR__ + __STACKSIZE__)
sta sp
stx sp+1

View File

@ -828,7 +828,7 @@ static void DoMemory (void)
stacksize);
}
if (overlaysize != -1 && apple == 0) {
if (overlaysize != -1) {
fprintf (outputSFile,
"\t.export __OVERLAYSIZE__ : absolute = $%04x\n\n",
overlaysize);

View File

@ -1,14 +1,15 @@
SYMBOLS {
__STACKSIZE__: type = weak, value = $0400;
__BACKBUFSIZE__: type = weak, value = $2000;
__OVERLAYSIZE__: type = weak, value = $2000 - $0C00;
__OVERLAYADDR__: type = weak, value = $0C00;
__VLIR0END__: type = weak, value = $C000 - __BACKBUFSIZE__ - __STACKSIZE__;
__OVERLAYSIZE__: type = weak, value = $0000;
__OVERLAYADDR__: type = weak, value = $C000 - __BACKBUFSIZE__ - __OVERLAYSIZE__;
__STACKSIZE__: type = weak, value = $0400;
__STACKADDR__: type = weak, value = $2000 - __STACKSIZE__;
}
MEMORY {
CVT: file = %O, start = $0, size = $20000;
ZP: define = yes, start = $80, size = $1A + $06;
VLIR0: define = yes, start = $4000, size = __VLIR0END__ - $4000;
EXT: define = yes, start = $0C00, size = __STACKADDR__ - $0C00;
VLIR0: define = yes, start = $4000, size = __OVERLAYADDR__ - $4000;
VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
@ -32,6 +33,7 @@ MEMORY {
SEGMENTS {
ZEROPAGE: type = zp, load = ZP;
EXTZP: type = zp, load = ZP;
EXTBSS: type = bss, load = EXT optional = yes;
FILEINFO: type = ro, load = CVT, offset = $002;
RECORDS: type = ro, load = CVT, offset = $100, optional = yes;
DIRENTRY: type = ro, load = CVT, offset = $180;

View File

@ -1,14 +1,14 @@
SYMBOLS {
__STACKSIZE__: type = weak, value = $0400;
__BACKBUFSIZE__: type = weak, value = $2000;
__OVERLAYSIZE__: type = weak, value = $0000;
__OVERLAYADDR__: type = weak, value = $8000 - __BACKBUFSIZE__ - __OVERLAYSIZE__;
__VLIR0END__: type = weak, value = __OVERLAYADDR__ - __STACKSIZE__;
__STACKSIZE__: type = weak, value = $0400;
__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 = __VLIR0END__ - $0400;
VLIR0: define = yes, start = $0400, size = __STACKADDR__ - $0400;
VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;