# Memory map, decode, vectors, the cartridge header Source tags as in [start-here.md](start-here.md). ## The map | Range | What | Decode | Notes | | --- | --- | --- | --- | | `$0000-$7FFF` | cartridge | `/CARTS` = A15 OR /E, to cartridge pin 32 | **not gated with R/W**: a write reaches the cartridge port with R/W low; a plain ROM cartridge ignores R/W, so a write is a bus fight on hardware and nothing in an emulator [sch], [kw] | | `$8000-$BFFF` | nothing | A15=1, A14=0 selects no chip | open bus. Homebrew hardware decodes here itself from A15/A14 on the port ([cartridge.md](cartridge.md)) | | `$C000-$C7FF` | nothing | `/IOS` low but A11=0 and A12=0 | open bus [sch] | | `$C800-$CFFF` | RAM, 1K | `/RAMS` = /IOS OR NAND(A11, E) | two images: `$C800-$CBFF` and `$CC00-$CFFF` (A10 is not decoded) [sch], [kw] | | `$D000-$D7FF` | 6522 VIA | CS1 = A12, /CS2 = `/IOS`, RS0-3 = A0-A3 | 128 images of 16 registers [sch], [kw] | | `$D800-$DFFF` | RAM **and** VIA | both selects true | a write goes to both; a read is a bus conflict. [kw]: "Don't use this area". MAME maps only the VIA at `$D000-$D7FF` and the RAM with one mirror [mame]; this range is U7 | | `$E000-$FFFF` | system ROM, 8K | /CE = NAND(A14, A15), /OE = NAND(A13, E) | Mine Storm `$E000-$EFFF`, Executive `$F000-$FFFF`. Not gated with R/W [sch] | `/IOS` = NAND(A14, A15) OR A13: low for `$C000-$DFFF`. All of it is two chips, a 74LS00 and a 74LS32 [sch]; the gate inputs above are as labelled on the redraw and should be re-read against the service manual's own drawing before the decode is called tier 2 (U7). Open bus: nothing is modelled by MAME (unmapped reads return its default) or vecx. The board should return the last byte on the data bus for unmapped reads and say it is a choice (U7). ## Vectors Read from the `B796` ROM's last 16 bytes [ran]: | Vector | Address | Points to | | --- | --- | --- | | reserved | `$FFF0` | `$0000` | | SWI3 | `$FFF2` | `$CBF2` (RAM) | | SWI2 | `$FFF4` | `$CBF2` (RAM) | | FIRQ | `$FFF6` | `$CBF5` (RAM) | | IRQ | `$FFF8` | `$CBF8` (RAM) | | SWI | `$FFFA` | `$CBFB` (RAM) | | NMI | `$FFFC` | `$CBFB` (RAM) | | RESET | `$FFFE` | `$F000` | Every interrupt lands in RAM, where a program that wants one has stored a 3-byte `JMP`. The Executive itself uses none: it polls the VIA's interrupt flag register (`Wait_Recal`'s `BITA