# Nova128 compiler memory map (E01-S05). docs/memory-map.md explains each # region and the evidence behind it. ld65 refuses any segment that overflows # its area, so this layout is also the compiler's capacity check. # # Bank 0 (CR=$0E) Bank 1 (CR=$4E) # $0000-$12FF system (BASIC/KERNAL) $0000-$1FFF hidden by common RAM # $1300-$18FF COMMON (copied at init) $2000-$BFFF BANK1 compiler tables # $1900-$19FF DISKBUF $C000-$FFFF system ROM (unmapped RAM) # $1A00-$1AFF private zero page (P0) # $1B00-$1BEF SCRATCH (common) # $1BF0-$1BFF MAILBOX # $1C01-$B7FF MAIN (stub, code, data) # $B800-$BFFF SWSTACK # $C000-$FFFF system ROM MEMORY { # Logical zero page. With P0 -> $1A00 these are physical $1A02-$1AFF. # $00/$01 are the 8502 port and are never allocated. ZP: file = "", start = $0002, size = $00FE, type = rw, define = yes; LOADADDR: file = %O, start = $1BFF, size = $0002; HEADER: file = %O, start = $1C01, size = $000C; MAIN: file = %O, start = $1C0D, size = $9BF3, define = yes; # to $B7FF COMMONRAM: file = "", start = $1300, size = $0600, define = yes; # to $18FF DISKBUF: file = "", start = $1900, size = $0100, define = yes; SCRATCH: file = "", start = $1B00, size = $00F0, define = yes; MAILBOX: file = "", start = $1BF0, size = $0010, define = yes; SWSTACK: file = "", start = $B800, size = $0800, define = yes; # to $BFFF BANK1: file = "", start = $2000, size = $A000, define = yes; # to $BFFF } SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; LOADADDR: load = LOADADDR, type = ro; EXEHDR: load = HEADER, type = ro; STARTUP: load = MAIN, type = ro; # first: SYS 7181 enters at $1C0D CODE: load = MAIN, type = ro; RODATA: load = MAIN, type = ro, optional = yes; DATA: load = MAIN, type = rw, optional = yes; COMMON: load = MAIN, run = COMMONRAM, type = rw, define = yes; BSS: load = MAIN, type = bss, optional = yes, define = yes; DISKBUF: load = DISKBUF, type = bss, optional = yes; SCRATCH: load = SCRATCH, type = bss, optional = yes; MAILBOX: load = MAILBOX, type = bss, optional = yes; SWSTACK: load = SWSTACK, type = bss, optional = yes; TABLES: load = BANK1, type = bss, optional = yes, define = yes; } SYMBOLS { # Physical bank-0 page that P0 maps to logical zero page in compiler states. __COMPILER_ZP_PAGE__: type = export, value = $1A; }