AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") (03/24/88)
=============================================
Pascal 1.1 protocol for character I/O devices
22-Mar-88
=============================================
David A. Lyons a.k.a. DAL Systems
PO Box 287 | North Liberty, IA 52317
BITNET: AWCTTYPA@UIAMVS
CompuServe: 72177,3233
GEnie mail: D.LYONS2
==============================================
References:
Apple IIgs Firmware Reference, December 23, 1986 DRAFT (chapter 5)
Apple II Miscellaneous Technical Note #3 [11/85] "Super Serial Card
Firmware Bug"
January 1986 Open Apple (vol 1, #12, page 101) & other Open Apple's
[Open Apple is $28/yr. P.O. Box 11250, Overland Park, KS 66207.]
Most 80-column cards and serial cards support the "Pascal 1.1" protocol
for character input and output. (//c and IIgs *ports* behave like cards
and follow this protocol.)
In the following discussion, "n" is the slot number (1 to 7) of the card
or port your program wants to deal with.
The ROM for slot n is from $Cn00 to $CnFF. $Cn0B contains $01 if the card
or port follows the Pascal 1.1 protocol.
$Cn0C identifies the kind of card:
$1x: printer
$2x: joystick
$3x: serial or parallel card
$4x: modem
$5x: sound or speech device
$6x: clock
$7x: disk or other storage device
$8x: 80-column card
$9x: network or bus interface
($Ax..$Fx are not currently defined)
The "x" can be used to distinguish between different cards of a particular
type.
$Cn0D to $Cn10 contain the *offsets* into the card's ROM of the Init, Read,
Write, and Status routines.
For example, if $Cn0D contains $34, then the Init entry point is $Cn34.
----------------------------------------------------------------------
>>> Before making any of these calls, the X register must be <<<
loaded with $Cn, and the Y register must be loaded with $n0!
Init (offset at $Cn0D):
Initializes the card; do this once before doing any other calls to
the card.
Read (offset at $Cn0E):
Reads one character from the card.
Returns: A = character read
X = error code
Write (offset at $Cn0F):
Writes one character to the card (from A).
Returns: X = error code
Status (offset at $Cn10):
Determines if the card is ready to accept output or provide input.
A = 0 checks output; A = 1 checks input.
Returns: X = error code
carry set = ready; carry clear = not ready
[Error codes: 0=no error; any others defined?]
----------------------------------------------------------------------
Notes:
o (Open Apple Vol 3, #12, page 3.96c) "Revision 1 IIc ROMs (the models
that don't support 3.5 drives) will not correctly return status
because of a missing CMP #$10 at $C227 in the firmware. The
result is that the status may be okay, but the result of the status
call says it isn't. This prevents using the Pascal inteface with
early IIcs."
[Does anybody have a work-around for this? A reasonable approach
might be to check for the original //c ROM version and then do
the STATUS call with a fixed version of the STATUS routine,
contained in your program.]
o Because the Super Serial card doesn't do it for you, twiddle location
$CFFF before making a Pascal 1.1 call to make sure no other slot's
ROMs are using the $C800..$CFFE space.
Also, you should store $Cn into $07F8 so that interrupt-handling
firmware can restore the correct $C800 space after an interupt
occurs.
o See Open Apple vol 3, #12, p. 92-94 and #9 p. 66-68 for more info
and real live examples.
----------------------------------------------------------------------
williamm@tramp.Colorado.EDU (Michael Williams) (03/25/88)
In article <8803222056.aa27863@SMOKE.BRL.ARPA> AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") writes: > [...] >References: > Apple IIgs Firmware Reference, December 23, 1986 DRAFT (chapter 5) > Apple II Miscellaneous Technical Note #3 [11/85] "Super Serial Card..." > [...] ^^^^^^^^^^^^^^ Where does one go about getting technical notes besides APDA? For the Mac, each of them are ftp'able from somewhere (Offhand I don't remember where); is this the case for the Apple ][ Tech Notes? Also, speaking of ftp'ing, has anybody compiled any lists, or know of any, apple2 pd sites? I have found very few sites, and those WITH an apple2 section aren't extrememly loaded. (And yes, I am aware of APPLE2-L, but am simply wondering about others.....) -Remo ------------------------------------------------------------------------ ..{nbires,hao,seismo,ihnp4}!boulder!tramp!williamm BIT: WILLIAMS@COLORADO.EDU SNAIL: 2905 E Aurora Ave #129, Boulder CO 80303