Skip to content

Commit 8907c06

Browse files
committed
Document sections in the linker configuration file.
1 parent 3b237d7 commit 8907c06

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

compiler/fastbasic-a5200.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,25 @@ MEMORY {
4444
}
4545

4646
SEGMENTS {
47+
# Interpreter ZP variables
4748
ZEROPAGE: load = ZP, type = zp, optional = yes;
49+
# The jump-table of the interpreter
4850
JUMPTAB: load = ROM, type = ro, define = yes, align = $100;
51+
# The interpreter functions
4952
RUNTIME: load = ROM, type = ro, define = yes;
53+
# The program bytecode
5054
BYTECODE: load = ROM, type = ro, define = yes;
55+
# Other (external) assembly code
5156
CODE: load = ROM, type = rw, define = yes;
57+
# The interpreter main loop, copied to ZP.
5258
INTERP: load = ROM, run = INTERP, type = rw, define = yes;
59+
# The interpreter data, copied to RAM.
5360
DATA: load = ROM, run = MAIN, type = rw, define = yes;
61+
# BSS, used for P/M graphics state
5462
BSS: load = MAIN, type = bss, optional = yes, define = yes;
63+
# HEAP, used to store program variables
5564
HEAP: load = MAIN, type = bss, optional = yes, define = yes, align = $100;
65+
# Cartridge information and headers
5666
CARTPAL: load = CARTPAL, type = ro;
5767
CARTNAME: load = CARTNAME, type = ro;
5868
CARTYEAR: load = CARTYEAR, type = ro;

compiler/fastbasic-cart.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,25 @@ MEMORY {
4343
}
4444

4545
SEGMENTS {
46+
# Interpreter ZP variables
4647
ZEROPAGE: load = ZP, type = zp, optional = yes;
48+
# The jump-table of the interpreter
4749
JUMPTAB: load = ROM, type = ro, define = yes, align = $100;
50+
# The interpreter functions
4851
RUNTIME: load = ROM, type = ro, define = yes;
52+
# The program bytecode
4953
BYTECODE: load = ROM, type = ro, define = yes;
54+
# Other (external) assembly code
5055
CODE: load = ROM, type = rw, define = yes;
56+
# The interpreter main loop, copied to ZP.
5157
INTERP: load = ROM, run = INTERP, type = rw, define = yes;
58+
# The interpreter data, copied to RAM.
5259
DATA: load = ROM, run = MAIN, type = rw, define = yes;
60+
# BSS, used for P/M graphics state
5361
BSS: load = MAIN, type = bss, optional = yes, define = yes;
62+
# HEAP, used to store program variables
5463
HEAP: load = MAIN, type = bss, optional = yes, define = yes, align = $100;
64+
# Cartridge header at the last 6 bytes
5565
CARTHDR: load = CARTID, type = ro;
5666
}
5767

compiler/fastbasic.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,28 @@ FORMATS {
4646
}
4747

4848
SEGMENTS {
49+
# Interpreter ZP variables
4950
ZEROPAGE: load = ZP, type = zp, optional = yes;
51+
# ZP variables used by the IDE and compiler
5052
IDEZP: load = ZP, type = zp, optional = yes;
53+
# 4 bytes for the binary header written when compiling from the IDE
5154
PREHEAD: load = PREMAIN, type = rw, optional = yes, define = yes;
55+
# The jump-table of the interpreter
5256
JUMPTAB: load = MAIN, type = ro, define = yes, align = $100;
57+
# The interpreter functions
5358
RUNTIME: load = MAIN, type = rw, define = yes;
59+
# The interpreter data
5460
DATA: load = MAIN, type = rw, define = yes;
61+
# The program bytecode
5562
BYTECODE: load = MAIN, type = rw, define = yes;
63+
# This is only for the IDE, main IDE assembly code
5664
CODE: load = MAIN, type = rw, define = yes;
65+
# Unused, available for including data that should be page aligned.
5766
ALIGNDATA:load = MAIN, type = ro, optional = yes, define = yes, align = $100;
67+
# BSS, used for P/M graphics state
5868
BSS: load = MAIN, type = bss, optional = yes, define = yes;
69+
# HEAP, used to store program variables
5970
HEAP: load = MAIN, type = bss, optional = yes, define = yes, align = $100;
71+
# The interpreter main loop, loaded in ZP.
6072
INTERP: load = INTERP, type = rw;
6173
}

0 commit comments

Comments
 (0)