Memory Map

A.C. Wright 6502 BIOS
Memory map · BIOS v1.5
The whole 64 KB
RangeWhat it is
$0000–$00FFZero page — Kernal, BASIC and Monitor workspace
$0100–$01FFThe 6502 stack
$0200–$07FFKernal and BASIC buffers — not yours
$0800–$7FFFYour program, your variables, your strings
$8000–$9FFFThe I/O window — eight cards, 1 KB each
$A000–$B7FFKernal
$B800–$BFFFCharacter set
$C000–$EDFFBASIC
$EE00–$FEFFMonitor
$FF00–$FFF9Wozmon
$FFFA–$FFFFNMI, RESET and IRQ vectors
Where your bytes go. A BASIC program starts at $0800 and grows up; the string heap starts at $8000 and grows down. When they meet you get ?OUT OF MEMORY ERROR.
The 198 bytes that are yours. Zero page from $003A up is unclaimed by the Kernal — but only for a program that has taken the machine over. Underneath a running BASIC it is in use, and a POKE there will not stick.
RAM, in detail
RangeSizeWhat lives there
$0000–$00FF256 BKernal, BASIC, Monitor and XModem workspace; $003A-$00FF is unclaimed by the Kernal
$0100–$01FF256 BHardware stack; BASIC keeps its FOR and GOSUB frames here
$0200–$02FF256 B256-byte input buffer filled by the encoders, drained by Chrin
$0300–$03FF256 BInterrupt vectors, cursor, HW_PRESENT, CF_DISK, BOOT_VECTOR, RTC and filesystem state, BASIC runtime pointers
$0400–$05FF512 BBAS_LINBUF raw input line ($0400) and BAS_TOKBUF tokenized scratch ($0500)
$0600–$07FF512 B512-byte sector buffer; any filesystem call clobbers it
$0800–$7FFF30 KBBASIC program text grows up from $0800; variables, then arrays, then the string heap growing down from $8000
ROM segments
RangeSizeSegment
$A000–$B7FF6 KBKERNAL
$B800–$BFFF2 KBCHARS
$C000–$EDFF11.5 KBBASIC
$EE00–$FEFF4.3 KBMONITOR
$FF00–$FFF9250 BWOZMON
$FFFA–$FFFF6 BVECTORS
One EEPROM, three version numbers. BIOS v1.5, BASIC V2.0 and Monitor v1.1 all ship in the same 32 KB chip.
The I/O window
SlotRangeBitCard
1$8000–$83FF$01RAM Card — AS6C4008 banked SRAM (low)
2$8400–$87FF$02RAM Card — AS6C4008 banked SRAM (high)
3$8800–$8BFF$04RTC Card — DS1511Y
4$8C00–$8FFF$08Storage Card — CompactFlash (8-bit True IDE)
5$9000–$93FF$10Serial Card — R65C51 / W65C51 ACIA
6$9400–$97FF$20GPIO Card / Input Board — W65C22 VIA
7$9800–$9BFF$40Sound Card — MOS 6581 SID / ARMSID
8$9C00–$9FFF$80Video Card / VGA Card — TMS9918A / Pico9918
What the machine found. $030D holds one bit per slot, written by the probe at reset. MEM prints it as HW=$xx; PEEK(781) reads it from BASIC.

Memory Map

A.C. Wright 6502 BIOS
Memory map · BIOS v1.5
Sound Card — $9800
AddressRegister
$9800SID_V1_FREQ_LO — Voice 1 Frequency Low
$9801SID_V1_FREQ_HI — Voice 1 Frequency High
$9802SID_V1_PW_LO — Voice 1 Pulse Width Low
$9803SID_V1_PW_HI — Voice 1 Pulse Width High
$9804SID_V1_CTRL — Voice 1 Control Register
$9805SID_V1_AD — Voice 1 Attack/Decay
$9806SID_V1_SR — Voice 1 Sustain/Release
$9807SID_V2_FREQ_LO — Voice 2 Frequency Low
$9808SID_V2_FREQ_HI — Voice 2 Frequency High
$9809SID_V2_PW_LO — Voice 2 Pulse Width Low
$980ASID_V2_PW_HI — Voice 2 Pulse Width High
$980BSID_V2_CTRL — Voice 2 Control Register
$980CSID_V2_AD — Voice 2 Attack/Decay
$980DSID_V2_SR — Voice 2 Sustain/Release
$980ESID_V3_FREQ_LO — Voice 3 Frequency Low
$980FSID_V3_FREQ_HI — Voice 3 Frequency High
$9810SID_V3_PW_LO — Voice 3 Pulse Width Low
$9811SID_V3_PW_HI — Voice 3 Pulse Width High
$9812SID_V3_CTRL — Voice 3 Control Register
$9813SID_V3_AD — Voice 3 Attack/Decay
$9814SID_V3_SR — Voice 3 Sustain/Release
$9815SID_FC_LO — Filter Cutoff Low
$9816SID_FC_HI — Filter Cutoff High
$9817SID_RES_FILT — Resonance/Filter
$9818SID_MODE_VOL — Filter Mode/Volume
$9819SID_PADDLE_X — Paddle X (Read-only)
$981ASID_PADDLE_Y — Paddle Y (Read-only)
$981BSID_OSC3 — Oscillator 3 (Read-only)
$981CSID_ENV3 — Envelope 3 (Read-only)
RTC Card — $8800
AddressRegister
$8800RTC_SEC
$8801RTC_MIN
$8802RTC_HR
$8803RTC_DAY
$8804RTC_DATE
$8805RTC_MON
$8806RTC_YR
$8807RTC_CENT
$8808RTC_ALARM_SEC
$8809RTC_ALARM_MIN
$880ARTC_ALARM_HR
$880BRTC_ALARM_DATE
$880CRTC_WD_L
$880DRTC_WD_H
$880ERTC_CTRL_A
$880FRTC_CTRL_B
$8810RTC_RAM_ADDR
$8813RTC_RAM_DATA
Storage Card — $8C00
AddressRegister
$8C00ST_DATA — R/W
$8C01ST_ERROR — Read
$8C01ST_FEATURE — Write
$8C02ST_SECT_CNT — R/W
$8C03ST_LBA_0 — R/W
$8C04ST_LBA_1 — R/W
$8C05ST_LBA_2 — R/W
$8C06ST_LBA_3 — R/W
$8C07ST_STATUS — Read
$8C07ST_CMD — Write
GPIO Card / Input Board — $9400
AddressRegister
$9400GPIO_PORTB
$9401GPIO_PORTA
$9402GPIO_DDRB
$9403GPIO_DDRA
$9404GPIO_T1CL
$9405GPIO_T1CH
$9406GPIO_T1LL
$9407GPIO_T1LH
$9408GPIO_T2CL
$9409GPIO_T2CH
$940AGPIO_SR
$940BGPIO_ACR
$940CGPIO_PCR
$940DGPIO_IFR
$940EGPIO_IER
$940FGPIO_ORA
Serial Card — $9000
AddressRegister
$9000SC_DATA — R/W
$9001SC_RESET — Write
$9001SC_STATUS — Read
$9002SC_CMD — R/W
$9003SC_CTRL — R/W
Video Card / VGA Card — $9C00
AddressRegister
$9C00VC_DATA — R/W
$9C01VC_REG — Write
$9C01VC_STATUS — Read
Banked RAM
AddressRegister
$8000RAM_DATA_L — R/W ($8000-$83FE)
$83FFRAM_BANK_L — Write-only RAM bank latch, value ($00-$FF) sets which of 256 ~1K banks of RAM is selected
$8400RAM_DATA_H — R/W ($8400-$87FE)
$87FFRAM_BANK_H — Write-only RAM bank latch, value ($00-$FF) sets which of 256 ~1K banks of RAM is selected
256 banks of 1 KB. Write a bank number to the latch, then read and write the window below it. From BASIC that is BANK n.