What it says on the tin. I dunno how to set up the linker script so it works with multiple banks, each with their own .c file.
What I have is this (it's for a custom 6502-based system with RAM at $0000-$1FFF and $6000-$7FFF):
What I have is this (it's for a custom 6502-based system with RAM at $0000-$1FFF and $6000-$7FFF):
Code:
MEMORY {
ZP: start = $00, size = $100, type = rw;
BSS: start = $200, size = $1E00, type = rw;
BSS2: start = $6000, size = $2000, type = rw;
HEADER: start = $0000, size = $10, file = %O;
BANK0: start = $8000, size = $4000, file = "bank/b0.bin";
BANK1: start = $8000, size = $4000, file = "bank/b1.bin";
BANK2: start = $8000, size = $4000, file = "bank/b2.bin";
BANK3: start = $8000, size = $4000, file = "bank/b3.bin";
BANK4: start = $8000, size = $4000, file = "bank/b4.bin";
BANK5: start = $8000, size = $4000, file = "bank/b5.bin";
BANK6: start = $8000, size = $4000, file = "bank/b6.bin";
BANK7: start = $8000, size = $4000, file = "bank/b7.bin";
}
SEGMENTS {
EXEHDR: load = HEADER, type = wprot;
CODE0: load = BANK0, type = wprot, define = yes;
CODE1: load = BANK0, type = wprot, define = yes;
CODE2: load = BANK0, type = wprot, define = yes;
CODE3: load = BANK0, type = wprot, define = yes;
CODE4: load = BANK0, type = wprot, define = yes;
CODE5: load = BANK0, type = wprot, define = yes;
CODE6: load = BANK0, type = wprot, define = yes;
CODE7: load = BANK0, type = wprot, define = yes;
ZEROPAGE: load = ZP, type = zp;
BSS: load = BSS, type = bss;
BSS2: load = BSS2, type = bss;
}
ZP: start = $00, size = $100, type = rw;
BSS: start = $200, size = $1E00, type = rw;
BSS2: start = $6000, size = $2000, type = rw;
HEADER: start = $0000, size = $10, file = %O;
BANK0: start = $8000, size = $4000, file = "bank/b0.bin";
BANK1: start = $8000, size = $4000, file = "bank/b1.bin";
BANK2: start = $8000, size = $4000, file = "bank/b2.bin";
BANK3: start = $8000, size = $4000, file = "bank/b3.bin";
BANK4: start = $8000, size = $4000, file = "bank/b4.bin";
BANK5: start = $8000, size = $4000, file = "bank/b5.bin";
BANK6: start = $8000, size = $4000, file = "bank/b6.bin";
BANK7: start = $8000, size = $4000, file = "bank/b7.bin";
}
SEGMENTS {
EXEHDR: load = HEADER, type = wprot;
CODE0: load = BANK0, type = wprot, define = yes;
CODE1: load = BANK0, type = wprot, define = yes;
CODE2: load = BANK0, type = wprot, define = yes;
CODE3: load = BANK0, type = wprot, define = yes;
CODE4: load = BANK0, type = wprot, define = yes;
CODE5: load = BANK0, type = wprot, define = yes;
CODE6: load = BANK0, type = wprot, define = yes;
CODE7: load = BANK0, type = wprot, define = yes;
ZEROPAGE: load = ZP, type = zp;
BSS: load = BSS, type = bss;
BSS2: load = BSS2, type = bss;
}