[comp.sys.apple2] apple memory locations

bruce@watnxt2.ucr.edu (Ahmon Dancy) (05/08/91)

I was wondering if anyone could give me information on these memory
locations in an Apple //e
 
$C019, $C002, $C004, $C000, $CFFF, $C008
 
thanks.

------------------------------------------------------------------------------
Bruce! (Ahmon Dancy)  Email Address: bruce@watnxt2.ucr.edu	|  mail me!
	Soon to be attending UC Berkeley      			|  EECS major
------------------------------------------------------------------------------

parkern@ (Neil Parker) (05/09/91)

In article <14250@ucrmath.ucr.edu> bruce@watnxt2.ucr.edu (Ahmon Dancy) writes:
>I was wondering if anyone could give me information on these memory
>locations in an Apple //e
> 
>$C019, $C002, $C004, $C000, $CFFF, $C008
> 
>thanks.

Gee...it looks like you've been trying to disassemble part of an
initialization routine of some machine-language program...

$C019 = RDVBLBAR
If the high bit of this byte is CLEAR, then the video circuitry is doing
"vertical blanking," which basically means moving the electron gun from the
bottom of the screen back to the top.  You can use this bit to synchronize
your drawing with the video circuitry to do all sorts of neat tricks.
(In the Apple IIGS, for some reason this bit has the opposite behavior--
vertical blanking is occurring when this bit is SET.)

$C002 = RDMAINRAM
Reading this byte returns the ASCII value of the most recent keypress.
Writing to this byte causes the auxiliary 64K of RAM to be DISABLED for
reading (subsequent memory reads will come from the main RAM bank).  This
is one half of a two-way switch--writing to $C003 (RDCARDRAM) selects the
auxiliary RAM for reading.

$C004 = WRMAINRAM
Reading this byte returns the ASCII value of the most recent keypress.
Writing to this byte causes the auxiliary RAM to be DISABLED for writing
(subsequent memory writes will go to the main RAM bank).  This is one half
of a two-way switch--writing to $C005 (WRCARDRAM) selects the auxiliary RAM
for writing.

$C000 = KBD or CLR80COL
Reading this byte is the OFFICIAL method of reading the keyboard.
Writing this byte disables 80-column bank switching--subsequent accesses to
$C054 and $C055 select text, lo-res, or hi-res page 1 or 2 respectively.
This is one half of a two-way switch--writing to $C001 (SET80COL) causes
$C054 and $C055 to become a bank-select switch, selecting between the
main-bank video buffer (containing odd-numbered columns) and the auxiliary
video buffer (containing even-numbered columns).  When this mode is
enabled, display page 2 is not available.

$CFFF = CLRROM
Accessing this location causes all cards in all slots to disable their
$C800-$CFFF ROMs.

$C008 = SETSTDZP
Reading this byte returns (what else?) the ASCII value of the latest
keypress.  Writing to this byte selects the main-bank zero-page, stack, and
language-card area for reading and writing.  This is one half of a two-way
switch--writing to $C009 (SETALTZP) selects the auxiliary-bank zero-page,
stack, and language-card ares for reading and writing.

               - Neil Parker
--
Neil Parker                 No cute ASCII art...no cute quote...no cute
parkern@jacobs.cs.orst.edu  disclaimer...no deposit, no return...
parker@corona.uoregon.edu   (This space intentionally left blank:           )