forge Documentation

memory-map

Memory Map

Complete Atari 8-bit computer memory map reference.

Overview

The Atari 8-bit computers use a 16-bit address space ($0000-$FFFF), organized into pages of 256 bytes each. Memory is divided into several regions:

  • Pages 0-1: Zero page and stack
  • Pages 2-5: OS database and user workspace
  • Page 6: Free user space
  • Page 7+: Screen region and program memory
  • Hardware: $D000-$D7FF
  • ROM: $C000-$FFFF (varies by model)

Page 0 ($0000-$00FF)

Zero Page - The first 256 bytes of memory, used by the OS and available for fast access.

OS Zero Page ($00-$7F)

The first half of page zero is reserved for the operating system.

Important addresses:

AddressHexNameDescription
$0000-$0001$0000-$0001LINZBS/LINFLGLine buffer (OS A) / Line flag (OS X)
$0002-$0003$0002-$0003CASINICassette initialization vector
$0004-$0005$0004-$0005RAMLOLow memory pointer
$0006$0006TRAMSZ/TRNSMZTransmit size (OS A/X)
$0008$0008WARMSTWarm start flag
$000A-$000B$000A-$000BDOSVECDOS vector
$000C-$000D$000C-$000DDOSINIDOS initialization vector
$000E-$000F$000E-$000FAPPMHIApplication high memory
$0010$0010POKMSKPOKEY mask (IRQEN shadow)
$0011$0011BRKKEYBreak key flag
$0012-$0014$0012-$0014RTCLOKReal-time clock (3 bytes)

BASIC/User Zero Page ($80-$FF)

The top half of page zero is free if BASIC is disabled. BASIC uses all but $CB-$D1. The floating point math routines use $D4-$FF.

Important addresses:

AddressHexNameDescription
$0080-$0081$0080-$0081LOMEMLow memory pointer
$0082-$0083$0082-$0083VNTPVariable name table pointer
$0084-$0085$0084-$0085VNTDVariable name table end
$0086-$0087$0086-$0087VVTPVariable value table pointer
$00D4-$00DF$00D4-$00DFFR0, FREFloating point registers
$00E0-$00E5$00E0-$00E5FR1Floating point register 1
$00E6-$00EB$00E6-$00EBFR2Floating point register 2

Page 1 ($0100-$01FF)

Stack - The 6502 stack. The stack pointer is initialized to $1FF and moves downward as the stack is filled.

Pages 2-5 ($0200-$05FF)

OS Database and User Workspace

OS Database ($0200-$047F)

Operating system database variables. Parts which are not used in some particular programs may be used for other purposes.

Important vectors:

AddressHexNameDescription
$0200-$0201$0200-$0201VDSLSTDisplay List Interrupt vector
$0202-$0203$0202-$0203VPRCEDPeripheral interrupt vector
$0204-$0205$0204-$0205VINTERInterrupt vector
$0206-$0207$0206-$0207VBREAKBreak interrupt vector
$0208-$0209$0208-$0209VKEYBDKeyboard interrupt vector
$0210-$0211$0210-$0211VTIMR1Timer 1 vector
$0212-$0213$0212-$0213VTIMR2Timer 2 vector
$0214-$0215$0214-$0215VTIMR4Timer 4 vector
$0216-$0217$0216-$0217VIMIRQMain IRQ vector
$0222-$0223$0222-$0223VVBLKIVertical Blank Immediate vector
$0224-$0225$0224-$0225VVBLKDVertical Blank Deferred vector
$0230-$0231$0230-$0231SDLSTL, SDLSTHDisplay List pointer (shadow)
$0232$0232SSKCTLSerial port control (shadow)

IOCB Structure:

IOCB 0 starts at $0340. Each IOCB is 16 bytes:

AddressHexNameDescription
$0340$0340ICHIDHandler ID (IOCB 0)
$0341$0341ICDNODevice number
$0342$0342ICCOMCommand
$0343$0343ICSTAStatus
$0344-$0345$0344-$0345ICBAL, ICBAHBuffer address
$0346-$0347$0346-$0347ICPTL, ICPTHPut routine pointer
$0348-$0349$0348-$0349ICBLL, ICBLHBuffer length
$034A-$034F$034A-$034FICAX1-6Auxiliary bytes

IOCB 1 starts at $0350, IOCB 2 at $0360, etc.

User Workspace ($0480-$05FF)

Free to be used by programs. If the floating point arithmetic package is not used, the user workspace extends to $6FF.

Floating Point Area ($57E-$5FF):

Used by the floating point arithmetic package. Free if the package is not used.

Page 6 ($0600-$06FF)

Free User Space - Atari has solemnly sworn never to put anything in this page of memory. This is safe for user programs.

Page 7+ ($0700+)

Screen Region and Program Memory

Boot Region ($0700)

Most machine language programs which don't use DOS load at this address. DOS extends from $700-$1CFB.

MEMLO

The address pointed to by MEMLO [$02E7,2 (743)] is the first byte of free memory. This pointer is usually changed by any program's initialization routine.

  • Upon power-up, MEMLO points to $700
  • When DOS loads, MEMLO changes to point to $2A80
  • AUTORUN.SYS programs change MEMLO to point above themselves

MEMTOP

MEMTOP [$02E5,2 (741)] is set by the OS whenever a graphics mode is entered. The graphics region is at the very top of RAM and extends downward.

APPMHI

APPMHI [$0E,2 (14)] should be set by any program to point to the highest address required by the program. If the OS cannot set up a screen without going below APPMHI it will return a not-enough-memory-for-screen-mode error.

Cartridge Slots

Right Cartridge Slot ($8000)

Beginning of the 8K bytes used by the right cartridge slot of the 800. This is also where 16K cartridges begin. If there is no cartridge here it is RAM.

Left Cartridge Slot ($A000)

Beginning of the left cartridge of the 800 or the only cartridge slot on all other models. This is where the BASIC ROM resides in the XL/XE models. This area is RAM if there is no cartridge or BASIC is disabled on XL/XE models.

Above Cartridges

$C000-$CFFF

This area is empty on the 800. Sometimes special ROM chips, such as Omnimon are wired in here. On the XL/XE models $C000-C7FF is free RAM if there are no cartridges. On XL/XE models, the OS ROM starts at $C800.

Hardware Registers ($D000-$D7FF)

This area is taken up by the hardware chips. The chips actually take only a fraction of this space.

GTIA Registers ($D000-$D01F):

  • Player/Missile horizontal positions
  • Player/Missile graphics
  • Color registers
  • Collision detection

POKEY Registers ($D200-$D2FF):

  • Audio channels
  • Serial I/O
  • Timers
  • Keyboard

PIA Registers ($D300-$D3FF):

  • Peripheral interface

ANTIC Registers ($D400-$D4FF):

  • Display list control
  • Scrolling
  • Character set
  • Display control

See Hardware Registers for complete details.

ROM Region

Character Set ($E000-$E3FF)

Location of the ATASCII character set.

OS ROM ($E400-$FFF7)

Operating system ROM.

Interrupt Vectors ($FFF8-$FFFF)

These last 8 bytes contain the addresses of the interrupt vectors. Upon power up the 6502 gets a reset pulse and looks up the reset routine here.

Memory Organization Summary

RegionAddress RangeDescription
Zero Page$0000-$00FFOS and user variables
Stack$0100-$01FF6502 stack
OS Database$0200-$047FOS vectors and variables
User Workspace$0480-$05FFFree for programs
Page 6$0600-$06FFFree user space
Boot/Program$0700+Program memory
Cartridge A$8000-$9FFFRight cartridge (800) or 16K cart
Cartridge B$A000-$BFFFLeft cartridge (800) or BASIC ROM (XL/XE)
Extended RAM$C000-$C7FFFree RAM (XL/XE, no cart)
OS ROM$C800-$FFFFOperating system ROM

Differences by Model

Atari 400/800 vs 1200XL vs 600/800XL

Some memory locations have different uses or names between OS versions. Consult the specific OS version documentation for details.

Related Topics