[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory Map for IIe (64K & 128K versions?)
Wraithe writes ...
>
> Does anyone have, or know of, a memory map for the various incarnations of
> the IIe? I'm specifically interested in where screen memory starts (text &
> graphics), keyboard, joystick, serial port, etc. I used to have all this
> stuff 15 years ago, on carefully noted handwritten sheets--I was in high
> school & too poor to afford the manuals, so I copied down anything I could
> find. I don't really need a hardcopy--actually, an electronic copy or
> web-site with the info would be great!
....
Below is a quickie memory map for a typical 64k Apple II which is,
also, the Main Bank of a 128k Apple II.
$0000 ---------------
ZERO Page area-- used for holding many system parameters, a few
system routines and variables, DOS & ProDOS parms, ... . Also,
this area has a number of 'open' addresses the user can employ.
$0100 ---------------
STACK page-- place where JSR return addresses, etc. gets PUSHed.
$0200 ---------------
Commands buffer area-- e.g. place where typed-in stuff usually gets
put first
$0300 ---------------
Mainly Open area-- a nice place to load in short machine language
routines (like sound routines, etc.) Roughly the upper 48 bytes
are used for holding Reset, IRQ, ... vectors and some DOS or ProDOS
vectors.
$0400 ---------------
Text "Page" 1 (or LoRes "Page" 1)-- Place where most TEXT you see on
a 40-col display is located (40 chars x 24 lines). If in Graphics
mode, you see a 16-color LoRes display (40 x 48). If in Graphics
mode with Full Graphics set, you see just LoRes. If in Graphics
mode with Mixed set, you get 40 lines of Lores with 4 lines of
TEXT at the bottom. (On a 128k Apple II, this can be used as half of
the 80-col. Text "Page" 1 or half of the Double-LoRes "Page" 1.)
$0800 ---------------
BASIC program area-- place where a BASIC program resides. This space
can be used for non-BASIC programs and routines, too (like stuff
you BRUN or large machine language routines you BLOAD to use along
with a BASIC program.
The space actually available for a BASIC program or ML routines or
whatever depends upon what other parts of the $0800-$BFFF space are
used for graphics, DOS or ProDOS, and DOS or ProDOS buffers.
$0800-$0BFF can be used as Text "Page" 2 (or LoRes "Page" 2).
This is rarely done; but, if it is, then a BASIC program must start
after $0BFF. (On a 128k Apple II, this can be used as half of
the 80-col. Text "Page" 2 or half of the Double-LoRes "Page" 2.)
$2000-$3FFF can be used as HiRes "Page" 1-- i.e. the place Hires
pics load in to be displayed. This is a fairly common use.
As long as a BASIC program, etc. is small enough, it can load
in at $0800 (actually $0801 for BASIC) as long as the space is not
being used as a second Text or Lores "Page". A large BASIC program
would usually load in after the HiRes area, at $4001. (On a 128k
Apple II, this can be used as half of the Double-HiRes "Page" 1.)
$4000-$5FFF can be used as HiRes "Page" 2-- i.e. another place
Hires pics load in to be displayed. This is a good place to load
in/display Hires pics for moderate size BASIC programs. Such
Programs will, then have $0801-$3FFF available (assuming no
Text or LoRes "Page" 2 is active and HiRes "Page" 1 is not used
for graphics. Sometimes, both HiRes "Pages" are used in order to
do speedier animations or for some other reason. If this is done,
you must start your BASIC program before the Hires areas or after.
(On a 128k Apple II, this can be used as half of the Double-HiRes
"Page" 2.)
$9000 --- (Approximately)----
DOS or ProDOS plus buffers use up most of this space.
$BFFF --------------- End of 'Program Space'
$C000 ---------------
Area usually employed for I/O, Soft-Switches, memory address space
for use by Slot cards, etc.
>>
From: kburtch@pts.mot.com and David Empson
Most of the names (assembler "equate" names) are listed in pairs, and
the comment on the first one often represents what the second actually
does, but refers to with what function the softswitch pair are
associated.
SOFTSWITCHES
KEYBOARD = $C000 ;keyboard data (latched) (Read)
Bit 7 is set to indicate a keypress is waiting, with the ASCII
code in bits 6-0.
CLR80STORE = $C000 ;use 80-column memory mapping (Write)
SET80STORE = $C001 ; (WR-only)
CLRAUXRD = $C002 ;read from auxilliary 48K (WR-only)
SETAUXRD = $C003 ; (WR-only)
CLRAUXWR = $C004 ;write to auxilliary 48K (WR-only)
SETAUXWR = $C005 ; (WR-only)
CLRCXROM = $C006 ;use external slot ROM (WR-only)
SETCXROM = $C007 ; (WR-only)
CLRAUXZP = $C008 ;use aux ZP, stack, & LC (WR-only)
SETAUXZP = $C009 ; (WR-only)
CLRC3ROM = $C00A ;use external slot C3 ROM (WR-only)
SETC3ROM = $C00B ; (WR-only)
CLR80VID = $C00C ;use 80-column display mode (WR-only)
SET80VID = $C00D ; (WR-only)
CLRALTCH = $C00E ;use alt character set ROM (WR-only)
SETALTCH = $C00F ; (WR-only)
STROBE = $C010 ;clear bit 7 of keyboard data ($C000)
If read, it also provides an "any key down" flag in bit 7, with
the keycode in the remaining bits. (These features only apply to
the IIe and later machines.)
Bit seven of these "RD..." locations is 1 if the condition is true
RDLCBNK2 = $C011 ;reading from LC bank $Dx 2
RDLCRAM = $C012 ;reading from LC RAM
RDRAMRD = $C013 ;reading from auxilliary 48K
RDRAMWR = $C014 ;writing to auxilliary 48K
RDCXROM = $C015 ;using external slot ROM
RDAUXZP = $C016 ;using auxilliary ZP, stack, & LC
RDC3ROM = $C017 ;using external slot C3 ROM
RD80COL = $C018 ;using 80-column memory mapping
RDVBLBAR = $C019 ;not VBL (VBL signal low)
RDTEXT = $C01A ;using text mode
RDMIXED = $C01B ;using mixed mode
RDPAGE2 = $C01C ;using text/graphics page2
RDHIRES = $C01D ;using Hi-res graphics mode
RDALTCH = $C01E ;using alternate character set ROM
RD80VID = $C01F ;using 80-column display mode
TAPEOUT = $C020 ;toggle the cassette output.
SPEAKER = $C030 ;toggle speaker diaphragm
STROBE = $C040 ;generate .5 uS low pulse @ Game pin 5
If read, you get one half-microsecond low pulse on the Game I/O
STROBE pin; if write, you get two pulses. (IIe and ][+ only, not
available on the IIgs).
CLRTEXT = $C050 ;display graphics
SETTEXT = $C051 ;display text
CLRMIXED = $C052 ;enable full graphics
SETMIXED = $C053 ;enable graphics/text mixed mode
PAGE1 = $C054 ;select text/graphics page1
PAGE2 = $C055 ;select text/graphics page2
See IIe, IIc, IIgs manual for details on how these switches
affect 80-col bank selection.
CLRHIRES = $C056 ;select Lo-res
SETHIRES = $C057 ;select Hi-res
SETAN0 = $C058 ;Set annunciator-0 output to 0
CLRAN0 = $C059 ;Set annunciator-0 output to 1
SETAN1 = $C05A ;Set annunciator-1 output to 0
CLRAN1 = $C05B ;Set annunciator-1 output to 1
SETAN2 = $C05C ;Set annunciator-2 output to 0
CLRAN2 = $C05D ;Set annunciator-2 output to 1
SETAN3 = $C05E ;Set annunciator-3 output to 0
CLRAN3 = $C05F ;Set annunciator-3 output to 1
Note: "0" is near 0V, "1" is near 5V.
SETDHIRES = $C05E ;if IOUDIS Set, turn on double-hires
CLRDHIRES = $C05F ;if IOUDIS Set, turn off double-hires
TAPEIN = $C060 ;bit 7 = data from cassette (read)
OPNAPPLE = $C061 ;open apple (command) key data (read)
CLSAPPLE = $C062 ;closed apple (option) key data (read)
These are actually the first two game switch inputs (SW0 and SW1),
which are borrowed by the Open Apple and Closed Apple keys.
Bit 7 is set in these locations if the game switch or
corresponding key is pressed.
SW2 = $C063 ;game input SW2 (read)
This input has an option to be connected to the shift key on
the keyboard. (See info on the 'shift key mod'.)
PADDLE0 = $C064 ;bit 7 = status of pdl-0 timer (read)
PADDLE1 = $C065 ;bit 7 = status of pdl-1 timer (read)
PADDLE2 = $C066 ;bit 7 = status of pdl-2 timer (read)
PADDLE3 = $C067 ;bit 7 = status of pdl-3 timer (read)
PDLTRIG = $C070 ;trigger paddles
Read this to start paddle countdown, then time the period until
$C064-$C067 bit 7 becomes set to determine the paddle position.
This takes up to three milliseconds if the paddle is at its maximum
extreme (reading of 255 via the standard firmware routine).
SETIOUDIS = $C07E ;enable DHIRES & disable $C058-5F (W)
CLRIOUDIS = $C07E ;disable DHIRES & enable $C058-5F (W)
For WR-enable LC RAM, the softswitch REQUIRES two successive reads
$C080 ;RD LC RAM bank2, WR-protect LC RAM
ROMIN = $C081 ;RD ROM, WR-enable LC RAM
$C082 ;RD ROM, WR-protect LC RAM
LCBANK2 = $C083 ;RD LC RAM bank2, WR-enable LC RAM
$C088 ;RD LC RAM bank1, WR-protect LC RAM
$C089 ;RD ROM, WR-enable LC RAM
$C08A ;RD ROM, WR-protect LC RAM
LCBANK1 = $C08B ;RD LC RAM bank1, WR-enable LC RAM
$C084-$C087 are echoes of $C080-$C083
$C08C-$C08F are echoes of $C088-$C08B
Bank 1 and Bank 2 here are the 4K banks at $D000-$DFFF. The
remaining area from $E000-$FFFF is the same for both
sets of switches.
CLRC8ROM = $CFFF ;disable Slot card C8 ROM
Reading any location from $Cn00-$CnFF (where n is the Slot) will
enable the $C800-$CFFF area for that card, if the card supports
this feature. Reading $CFFF disables this area for all cards.
<<
$D000 ---------------
Usually employed for BASIC in-ROM or for one of two 4kB "Language
Card" banks of RAM.
$E000 ---------------
Usually employed for BASIC in-ROM (continued) and the Monitor in-ROM or
for one 8kB "Language Card" bank.
In-ROM BASIC runs from $D000-$F7FF
The In-ROM Monitor runs from $F800-$FFFF
$FFFF --------------- End of 64kB "Main Bank" memory
Rubywand