1. Memory Layout (BK-0010 / BK-0010-01) Address (octal) Purpose 000000 - 000377 Interrupt vectors, system variables, stack (~0.5 KB) 000400 - 037777 User RAM, BASIC programs & data (~15.5 KB) 040000 - 077777 Framebuffer / video RAM (~16 KB) 100000 - 117777 System monitor ROM (~8 KB) 120000 - 137777 BASIC ROM #1 (~8 KB) 140000 - 157777 BASIC ROM #2 (~8 KB) 160000 - 177577 BASIC ROM #3 (~7.5 KB) 177600 - 177777 Hardware registers (~0.5 KB) BK-0010 Memory Map Here is the breakdown of the memory pages. Note that in the PDP-11 world, octal is the "native" language, so those addresses are the most precise way to view the hardware boundaries. Page Octal Address Range Decimal Address Range Typical Usage 0 000000 - 017777 00000 - 08191 User RAM (System variables/Stack) 1 020000 - 037777 08192 - 16383 User RAM 2 040000 - 057777 16384 - 24575 Video RAM (Screen Buffer) 3 060000 - 077777 24576 - 32767 Video RAM (Screen Buffer) 4 100000 - 117777 32768 - 40959 ROM (BASIC / FOCAL) 5 120000 - 137777 40960 - 49151 ROM (BASIC / FOCAL) 6 140000 - 157777 49152 - 57343 ROM (BASIC / FOCAL) 7 160000 - 177777 57344 - 65535 Monitor ROM & I/O Registers 2. BK-0010 Memory Map (with FDD Controller) In a standard configuration with a disk interface (like the KNGMD), the mapping for the first 32 KB (RAM) remains the same, but the upper 32 KB is managed to allow for the Disk Operating System. Page Octal Address Range Decimal Address Range Usage with FDD 0 000000 - 017777 00000 - 08191 User RAM / System Stack 1 020000 - 037777 08192 - 16383 User RAM 2 040000 - 057777 16384 - 24575 Video RAM 3 060000 - 077777 24576 - 32767 Video RAM 4 100000 - 117777 32768 - 40959 FDD Controller ROM (Bootloader) 5 120000 - 137777 40960 - 49151 FDD ROM / RAM Buffer 6 140000 - 157777 49152 - 57343 System ROM (Monitor) 7 160000 - 177777 57344 - 65535 I/O Registers (FDD & System) The 16 RAM Pages (Hardware View) The BK-0011M is where things get truly "modern" (for the 1980s). Unlike the BK-0010, which had a fixed 32 KB of RAM, the BK-0011M features 128 KB of RAM, divided into 16 banks of 8 KB each. To access all that memory through a 16-bit (64 KB) CPU, it uses heavy bank switching. The 64 KB address space is split into four 16 KB windows. 3.BK-0011M Logical Memory Map (CPU View) The CPU sees four "Windows." While the addresses are fixed, what is inside them can be swapped out using the System Control Register (usually at octal 177716). Window Octal Address Range Decimal Address Range Usage / Contents 0 000000 - 037777 00000 - 16383 RAM Page 0 (Fixed, contains vectors) 1 040000 - 077777 16384 - 32767 RAM Page 1 (Usually Video RAM) 2 100000 - 137777 32768 - 49151 Switchable RAM/ROM (Pages 2-15) 3 140000 - 157777 49152 - 57343 System ROM (BOS / Monitor) I/O 160000 - 177777 57344 - 65535 Internal Registers Page # Octal Start Decimal Start Primary Function 0 000000 00000 System RAM (Lower) 1 020000 08192 System RAM (Upper) 2 040000 16384 Video RAM Layer 0 3 060000 24576 Video RAM Layer 1 4 100000 32768 User RAM / Buffer 5 120000 40960 User RAM / Buffer 6 140000 49152 User RAM / Buffer 7 160000 57344 User RAM / Buffer 8-15 - - Extended RAM (used by RAM disks/OS) 4. BK-0011M + SMK-512 (without bank switching active) Octal Address Size Description 000000 - 000377 256 B Interrupt vectors 000400 - 077777 32 KB Main RAM (user RAM) 100000 - 137777 16 KB Video RAM (screen memory) 140000 - 157777 8 KB Monitor ROM 160000 - 173777 6 KB BASIC / FOCAL / BOS ROM (depending on config) 174000 - 177577 ~3.5 KB Extension ROM / cartridge 177600 - 177777 128 B I/O registers SMK-512 adds 512 KB physical RAM, divided into 32 x 16 KB pages. The CPU still sees only 64 KB at once, but: The region 000000 - 077777 (lower 32 KB) And sometimes 100000 - 137777 can be bank-switched. Control Register (#177130) - the same shared with FDD (backwards compatible to 326). The memory window remapping logic: SMK-512 Logic Cheat Sheet -------------------------- Bit Name Function 0-4 Page Selection Selects one of 32 physical 16KB banks from the 512KB array. 5 Window Map 0: Map to #100000 (Window 2). 1: Map to #040000 (Window 1). 6 Write Protect 1: RAM is writable. 0: RAM acts as Read-Only (ROM mode). 7 Override 1: Override (Muzzle) internal system ROM/RAM. 0: Listen-only mode. 8-15 Ext Super-SMK Standard SMK Extends page count beyond 512KB (some emulators) ------------------------------------------ setFDD11MModel mappings explained by AI: The critical key is understanding mapLongPage and the memory array: protected short[] memory = new short[368640]; // flat array of 16-bit WORDS protected void mapLongPage(int longSlot, int offset, boolean writeable) { int shortSlot = longSlot << 2; // each longSlot is 4 short slots for(pageMask = 0; pageMask < 4; ++pageMask) { this.mMap[pageMask + shortSlot] = offset; offset += 1024; // +1024 WORDS per sub-slot = 2KB each } ... } public void setFDD11MModel() { Each mapLongPage covers **4 x 1024 words = 4096 words = 8192 bytes = 8KB**. This is exactly one BK physical page. The offset parameter is a **word index** into memory[], not a byte address and not a BK address-space value. The memory[] array is laid out as follows (proven by the named constants in the source): Word index Named constant Content ___________________________________________________________________________ 00000 (RAM page 0) Physical RAM page 0 (8KB) 04096 (RAM page 1) Physical RAM page 1 (8KB) 08192 (RAM page 2) Physical RAM page 2 - video (8KB) 12288 (RAM page 3) Physical RAM page 3 - video (8KB) 16384 OF_RAMB10_120 Physical RAM page 4 (8KB) 20480 OF_RAMB10_140 Physical RAM page 5 (8KB) 24576 (RAM page 6) Physical RAM page 6 (8KB) 28672 (RAM page 7) Physical RAM page 7 (8KB) 32768 (RAM page 8) Physical RAM page 8 - EXTENDED 36864 (RAM page 9) Physical RAM page 9 - EXTENDED 40960 (RAM page 10) Physical RAM page 10 - EXTENDED 45056 (RAM page 11) Physical RAM page 11 - EXTENDED 49152 (RAM page 12) Physical RAM page 12 - EXTENDED 53248 (RAM page 13) Physical RAM page 13 - EXTENDED 57344 (RAM page 14) Physical RAM page 14 - EXTENDED 61440 (RAM page 15) Physical RAM page 15 - EXTENDED 65536 OF_ROMB10_100 BK-10 Monitor ROM (monit10.rom) 69632 OF_ROMBASIC10_120 BK-10 BASIC ROM segment 1 (basic10.rom) 73728 OF_ROMBASIC10_140 BK-10 BASIC ROM segment 2 77824 OF_ROMBASIC10_160 BK-10 BASIC ROM segment 3 81920 OF_ROMB11M_140 BK-11M BOS/Monitor ROM (b11m_bos.rom) 86016 OF_ROMB11M_120 BK-11M Extension ROM (b11m_ext.rom) 90112 OF_ROMBASIC11M_1_100 BK-11M BASIC ROM bank 1 (bas11m_1.rom) 94208 OF_ROMBASIC11M_0_100 BK-11M BASIC ROM bank 0 (bas11m_0.rom) 102400 OF_ROMEXT FDD ROM or SMK ROM (fdd.rom / smk512.rom) The pattern is exact: physical RAM page N starts at word index N x 4096. ## The Full setFDD11MModel Mapping Explained BK Window | BK Addresses | memory[] word index | Physical meaning ___________________________________________________________________________ 0 | 0x0000-0x1FFF | 0 (RAM page 0) | Standard lower RAM [R/W] 1 | 0x2000-0x3FFF | 4096 (RAM page 1) | Standard lower RAM [R/W] 2 | 0x4000-0x5FFF | 49152 (RAM page 12) | Extended RAM page 12 [R/W] 3 | 0x6000-0x7FFF | 53248 (RAM page 13) | Extended RAM page 13 [R/W] 4 | 0x8000-0x9FFF | 32768 (RAM page 8) | Extended RAM page 8 [R/W] 5 | 0xA000-0xBFFF | 36864 (RAM page 9) | Extended RAM page 9 [R/W] 6 | 0xC000-0xDFFF | 81920 = OF_ROMB11M_140 | BK-11M Monitor BOS ROM [R only] 7 | 0xE000-0xFFFF | 102400 = OF_ROMEXT | FDD ROM [R only] LongPage = one BK 8KB physical bank = 4096 words public void setFDD11MModel() { this.is11M = true; this.mapLongPage(0, 0, true); this.mapLongPage(1, 4096, true); int addr = 49152; // 0xC000 - extended RAM page 12 (word index 12 x 4096) this.mapLongPage(2, addr, true); this.mapLongPage(3, addr + 4096, true); // page 13 addr = 32768; // 0x8000 - extended RAM page 8 (word index 8 x 4096) this.mapLongPage(4, addr, true); this.mapLongPage(5, addr + 4096, true); // page 9 this.mapLongPage(6, 81920, false); // OF_ROMB11M_140 - BK-11M BOS Monitor ROM this.mapLongPage(7, 102400, false); // OF_ROMEXT - FDD ROM this.page160length = 4096; }