-
Notifications
You must be signed in to change notification settings - Fork 8
/
memory.cfg
55 lines (55 loc) · 2.21 KB
/
memory.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# Config file for FDISK memory layout.
# SCREEN is 80x25 at $8000, so leave a hole there
#
FEATURES {
STARTADDRESS: default = $0801;
}
SYMBOLS {
__LOADADDR__: type = import;
__EXEHDR__: type = import;
__PRGSTART__: type = weak, value = $0801;
__STACKSIZE__: type = weak, value = $1000;
__SCRN__: type = weak, value = $8000; # SCREEN is at $8000-$9000
__SCRNEND__: type = weak, value = $9000;
__HIMEM__: type = weak, value = $D000;
# we define MAIN_START and _SIZE directly, to place top of stack at $CFFF
__MAIN_START__: type = weak, value = $0801;
__MAIN_SIZE__: type = weak, value = $c7fe; # this is $CFFF for top of stack
}
MEMORY {
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;
# CODE is our area for the program, and it is limited by SCRN at $8000
CODE: file = %O, start = __HEADER_LAST__, size = __SCRN__ - __HEADER_LAST__;
BSS: file = "", start = __SCRNEND__, size = __HIMEM__ - __SCRNEND__ - __STACKSIZE__ - 1;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = HEADER, type = ro;
STARTUP: load = CODE, type = ro;
LOWCODE: load = CODE, type = ro, optional = yes;
CODE: load = CODE, type = ro;
RODATA: load = CODE, type = ro;
DATA: load = CODE, type = rw;
INIT: load = CODE, type = rw;
ONCE: load = CODE, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = ONCE;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}