[comp.sys.atari.8bit] Info-Atari8 Digest V87 #99

VAUGHAN@CANISIUS.BITNET (Tom Vaughan @ Computer Center) (11/23/87)

Here is the DOCs and UUE T: handler for the Xm301.  I couldn't get
it to work with Kermit65.  If someone does, please let me know!


     ATARI[R] XM301 MODEM[TM]
  TECHNICAL SOFTWARE SPECIFICATIONS


This manual contains the reference
specifications for the software
interfaces used by applications
programs and the Operating System to
control the XM301 Modem.


              Contents

Section 1: Description of the XM301
Modem
   Interface With Other Products
   Family of Products
   Reference Documents
Section 2: Logical Requirements for
the XM301 Modem
   Man/Machine Interface
   The Six Standard Input/Output
Command Interfaces
     OPEN
     CLOSE
     INPUT
     OUTPUT
     STATUS
   Parameters Passed as Data Strings
   Error Handling
   Buffer Use
   Handler/Operating System Interface


              SECTION 1
   DESCRIPTION OF THE XM301 MODEM


The XM301 Modem is a stand-alone
peripheral which connects to the
ATARI 400[TM]/800[TM], and the
XL[TM]/XE[TM] series with the SIO
interface by means of the serial bus.
The modem connects to the telephone
line by means of the RJ-11C jack.


The modem control software resides in
the internal ROM of the 8048 single
chip microprocessor.  A separate
software handler will be disk-based.


Interface With Other Products


The XM301 Modem is an input-output
peripheral, and performs no actions
without instructions from an
applications program.


To use the XM301 Modem from a
high-level language, the following
types of commands are required:

    OPEN
    CLOSE
    GET (or equivalent READ, INPUT)
    PUT (or equivalent PRINT, WRITE)
    POKE
    PEEK


Family Of Products


The XM301 Modem performs
telecommunications functions in
conjunction with applications
designed specifically for use with
the XM301.  It is interface
compatible with the Telelink II[TM]
application.  The modem is capable of
accepting any commands issued by the
Telelink II handler without
performing in an irregular fashion or
returning the "illegal command" error
code.


Reference Documents


ATARI Home Computer System Technical
Reference Notes:
  Operating System User's Manual
  Operating System Source Listing and
Hardware Manual


The Technical Reference Notes are
available from ATARI Customer
Relations, P.O. Box 61657, Sunnyvale,
CA  94088.  Cost:  $29.95 plus $2.50
for shipping.  California residents
should add appropriate sales tax.
Write "Order for Technical Reference
Notes" on the outside of the envelope
to speed up the order process.


              SECTION 2
 LOGICAL REQUIREMENTS FOR THE XM301
MODEM


The handler is provided by an
AUTORUN.SYS disk file.


The modem controller, an 8048H
microprocessor, is accessed by the
handler through the serial I/O
channel.


The handler uses RAM for input and
output buffers, variables for
communicating with the user, and
internal variables.  Internal
variables are in low memory, with one
variable (CMCMD) permanently
allocated in the Operating System
database for use by this handler.


User communication variables are the
system IOCBs, the zero page IOCB, and
the command flag CMCMD.  IOCB use is
described in the ATARI Home Computer
System Technical Reference Notes, and
in Section 2, Handler/Operating
System Interface.  CMCMD use is
described in Section 2, Parameters
Passed As Data Strings.


The XM301 handler allocates an input
and output buffer where data can be
entered between the application and
the handler.  The output is 64 bytes
long; the input buffer is 256 bytes
long.  There are 2 bytes used for
buffer control variables by the
handler.  Applications use of buffer
control bytes is described in Section
2, Buffer Use.  The remainder of the
buffer area is reserved for the
buffers.  The use of the buffer area
is decided upon by the handler.  The
application program has no defined
way of directly accessing data in
this area.


Man/Machine Interface


It is the responsibility of the mass
storage media device to contain and
load the XM301 handler along with the
required applications.


The Six Standard Input/Output Command
Interfaces


The applications program accesses the
modem handler by  calling on CIO,
which in turn, calls the handler.
There are six I/O calls.


(1)  OPEN


An OPEN command must be performed
before any other modem operations are
allowed.  Any of the IOCBs may be
used.  Aux1 specifies the I/O
direction:  bit 2 for input; bit 3
for output; both for bidirectional.
The directionality applies only to
communications data; initialization
parameters are passed in either
direction after any OPEN command.
Aux2 is ignored by the handler.


The device name is "T".  The rest of
the filename is ignored.


The command flag (CMCMD) is set to
zero by the handler during OPEN.


(2)  CLOSE


The CLOSE command terminates the I/O
procedure and releases the IOCB.  Any
data waiting in the output buffer is
sent first.  The buffer area is then
relinquished and any input data
remaining in the buffer is lost.
When the buffer area is empty, the
phone is placed on hook.


[System.Reset] produces similar
results to the CLOSE command except
that the output buffer is not sent.
Refer to Section 2, Handler/Operating
System Interface, for details.


The modem operation may be suspended
without closing the IOCB, allowing
the serial bus to continue
communicating with other devices.
This operation is described under the
appropriate commands in Section 2,
Parameters Passed As Data Strings.


(3)  INPUT


Any INPUT or GET operation through
CIO will result in the modem handler
being asked to provide data for the
user.


If no data is available, the handler
waits for a character.  There is no
time-out when waiting for received
data.  This waiting is terminated
when either the [Break] or
[System.Reset] key is pressed.  The
waiting is also terminated if the
carrier is lost. Error 136 is
returned when the carrier is lost.


If data has been received, the
Handler stores the characters in the
input buffer as the data is received
(up to the buffer's capacity).  The
CIO request for data is then
satisfied from this FIFO buffer.
(See Section 2, Buffer Use.)


The modem is double-buffered, so the
handler has one character time to
input each character received.


Communications data is processed for
parity and for translation from ASCII
to ATASCII.  These operations are
described under the appropriate
commands in Section 2, Parameters
Passed As Data Strings.


(4)  OUTPUT


Any PRINT or PUT operation to CIO
will result in one or more bytes for
the handler to hand to the modem.

This data is interpreted either as
set-up commands and parameters, or as
communications data, as controlled by
the command flag byte CMCMD.  (See
Section 2, Parameters Passed As Data
Strings.)


Communications data is processed for
translation from ATASCII to ASCII,
and then from parity.  These
operations are described under the
appropriate commands in Section 2,
Parameters Passed As Data Strings.


Output bytes are received by the
handler and placed into the output
buffer as fast as the bytes come from
CIO.  If the FIFO buffer fills, the
handler loops other character from
CIO until space becomes available in
the buffer.  There is no time-out
when the handler is waiting for
buffer space.  The looping is broken
when either the [Break] or
[System.Reset] key is pressed.  A
loss of carrier also breaks the loop,
and returns Error 136.


Any time the buffer contains data,
the modem continues to send until the
buffer is emptied.


(5)  STATUS (Combines with PEEK)


The STATUS command causes the handler
to place four bytes of status
information in the Operating System
status area DVSTAT through DVSTAT+3
(02EA - 02ED).  These four bytes
contain error and status information
from both the modem and from the
handler.  The application program can
then PEEK at these four bytes.


The four bytes contain the following
bit-encoded data:


DVSTAT+0:  Communications Error Flags


The internal flags corresponding to
the status bits in this byte are
reset upon STATUS request.


Bit 7: Framing error encountered on
received data.


Bit 6:  Byte-level overrun
encountered.  The modem lost one or
more characters due to slow interrupt
handling.  This is caused either by
slow reading of data by the
application, or by an incorrectly
programmed main CPU.


Bit 5:  Parity error encountered on
received data.


Bit 4:  Received data buffer
overflow. The received data buffer
overflowed because the applications
program did not input data from the
buffer in time.  If the received
buffer has not been supplied, only
error bit 6 is set.


Bit 3:  Zero  (Reserved for
expansion).


Bit 2:  Zero  (Reserved for
expansion).


Bit 1:  Zero  (Reserved for
expansion).


Bit 0:  Illegal command (recognized
by handler).  This error applies only
to the most recent command.  This
error is cleared upon acceptance of a
legal command.


DVSTAT+1:  Modem  Status Flags

Bit 7:  Carrier detect.  1 when the
carrier is present.


Bit 6:  Zero  (Reserved for
expansion).


Bit 5:  Loop Test enabled.  1 when
Analog Loopback Test is active.


Bit 4:  Originate/Answer.  Zero =
originate, 1 = answer.


Bit 3:  Auto-Answer.  1 = enabled, 0
= disabled.


Bit 2:  DTMF dialing.  1 for DTMF
dialing.
                       0 for pulse
dialing.

Bit 1:  Zero  (Reserved for
expansion)

Bit 0:  Off hook.  1 when the phone
is off-hook.
                   0 when the phone
is on-hook.


DVSTAT+2:  All bits set to zero.
(Reserved for expansion).

DVSTAT+3:  All bits set to zero.
(Reserved for expansion).

(6)  SPECIAL (XIO)


This call is not supported by the
handler.  The handler returns Error
92 (hex), 146 (decimal), Function Not
Supported.


Parameters Passed As Data Strings


Control functions (i.e., setting
translation and parity handling,
sending a break signal, and dialing
the telephone) are handled by passing
the commands and parameters to the
handler as the output and input data.


There are two types of commands:
Those with parameters and those
without.  Commands start with a
two-byte escape saequence output to
the modem handler.  This escape
sequence identifies the start of the
command and specifies the command.
If the command containsparameter
bytes, they are sent immediately
following the escape sequence.


In normal operation, the CIO output
deals only with communications data.
The handler checks the Operating
System RAM area command flag byte
CMCMD as it receives each output from
CIO.  (CMCMD is fixed in the
Operating System database at location
0007.)  If the flag is zero, the
handler treats the byte as
communications data.  If the flag is
nonzero, the handler treats the byte
as a command.


When the handler is not processing a
command, output bytes sent with CMCMD
nonzero are checked for a command and
are not transmitted.  The handler
starts processing a command when:  It
is not processing a previous command;
CMCMD is nonzero; or the output data
byte received is ESC (1B hex, 27
decimal).  Once a command sequence
starts, the handler finishes the
sequence regardless of the state of
CMCMD.  The number of output and
input bytes is constant for any given
command (except the DIAL command).
When the command bytes have been
passed, the handler again checks
CMCMD with each output byte.


Commands start with two output bytes:
[Esc] followed by the command letter;
and the commands with output
parameters containing those two bytes
followed by the parameter.


The handler ensures proper sequencing
of commands with output data by
emptying the output buffer prior to
processing the command.  This
operation occurs when the command is
accepted (i.e., the command letter is
accepted).  During this output buffer
drain, communications input
characters are saved in the input
buffer.


With both the handler and modem,
communications being received are
placed in the input buffer even when
commands are being processed.


Except with the BREAK command, each
command below is completed when the
handler returns from accepting the
final byte.  Execution of a command
may result in an error which is
returned by the handler to the
application when the command
completes execution. (See Section 2,
Error Handling.)


Illegal commands (command letter not
valid) produce Error 84 (hex) 132
(decimal), an invalid command, and
are not processed.


The commands are defined as follows:


SET TRANSLATION:  (A ASCII, 41 hex,
65 decimal)


Two bytes of parameter follow this
command.  The first specifies the
translation options.  The second is
the will-not-translate substitution
character.  Translation always
follows parity checking on input, and
always precedes parity setting on
output.  The translation options are
interpreted as follows:


Bit 7:  Ignored by the modem.


Bit 6:  When 1, specifies appending
linefeed (0A hex, 10 decimal)
whenever a Carriage Return (OD hex,
13 decimal) is transmitted.  This bit
is ignored if bits 5-4 of this
parameter byte are 10 or 11.  The
Carriage Return character may come
either from the untranslated ATASCII
graphics character with code OD hex,
or from the translation of ATASCII
EOL (9B hex, 155 decimal) to CR.
This translation option has no effect
on input data.  The initialization
default for this bit is 1.


Bits 5 & 4:  When 10 or 11, specifies
no translation.  This option
suppresses bit 6.


When 00, specifies minimal ("light")
translation.  On input, Carriage
Return (0D hex, 13 decimal) is
converted to EOL (9B, 155).  On
output, EOL is converted to CR.  Bit
7 of code is cleared in both cases
with the exception of EOL (9B, 155).


When 01, specifies major ("heavy")
translation.  Codes whose
interpretations in ATASCII do not
correspond to the ASCII
interpretation are untranslatable.
Codes below Blank (20 hex, 32
decimal) and codes above Vertical Bar
(7C hex, 124 decimal) are
untranslatable, with the exception of
Carriage Return and EOL.  CR and EOL
are translated just as in mode 00.
On output, untranslatable codes are
suppressed and not transmitted.  On
input, untranslatable codes are
converted to the will-not-translate
substitution character supplied by
the user.


Bits 3 - 0:  Ignored by the modem.


SET PARITY:  (C ASCII, 43 hex, 67
decimal)


One byte of parameter follows this
command.


Bits 7 - 4:  Ignored by the modem.


Bits 3 & 2:  Specify input parity
operation.  The input parity
operation precedes the translation
operation.  00 specifies no parity
operation.  01 specifies an odd
parity check.  10 specifies even
parity checking.  Should any parity
check fail, the parity error status
bit is set.  11 specifies no parity
checking.  In all but mode 00, the
parity bit is cleared after the
check.  The parity bit is always bit
7 (high-order bit) of the 8-bit form
of the character, regardless of
transmission byte size.  The default
for these bits is 00.


Bits 1 & 0:  Specify output parity
generation.  The output parity
operation follows the translation.
If LF is appended to CR, each is
treated separately for parity.  00
specifies even parity.  11 specifies
forcing the parity bit to 1.  The
parity bit is always bit 7
(high-order bit) of the 8-bit form of
the character, regardless of
transmission byte size.  The default
for these bits is 00.


END OF COMMANDS:  (E ASCII, 45 hex,
69 decimal)


The handler sets the command flag
CMCMD to zero when it receives this
command.  The user has the option of
ending command mode either by poking
CMCMD to zero or by including this
command in the output.


STATUS:  (F ASCII, 46 hex, 70
decimal)


Performs the same function as the C10
STATUS call (DVSTAT through DVSTAT+3
shall be filled in the Operating
System RAM area).  This alternate
status call is supplied for
high-level languages lacking the C10
STATUS call.  No data is returned in
the input stream.


SET AUTO-ANSWER:  (G ASCII, 47 hex,
71 decimal)


The modem is set in the AUTO-ANSWER
Mode.  (The default  AUTO-ANSWER is
disabled.)  Once Auto-Answer is
enabled, all subsequent incoming
phone calls will be considered as
computer connections.  To disable the
Auto-Answer use the [Esc][T] command.


BREAK:  (H ASCII, 48 hex, 72 decimal)


A BREAK signal is transmitted.  The
execution of this command is deferred
(control returns immediately and the
BREAK is sent for the following
500ms).  Output data is buffered
until the BREAK finishes.


Since the BREAK transmission proceeds
concurrently as control is returned
to the caller, another command may be
given to the modem handler before the
BREAK is completed.  Should this
happen, the handler finishes the
break and transmits any characters
being held in the output buffer
before executing the new command.


SET ORIGINATE:  (I ASCII, 49 hex, 73
decimal)


The modem is set in Originate Mode
(the default).


SET ANSWER:  (J ASCII, 4A hex, 74
decimal)


The modem is set in Answer Mode.


DIAL DIGITS:  (K ASCII, 4B hex, 75
decimal)  Used for pulse dialing.


A string of digits to dial follows
this command.  Each digit is held in
one byte.  The handler ignores the
most significant four bits of each
digit byte, and interprets the
low-order bits as follows:


0 - 9     Digit to dial, 0 through 9


B         End-of digits


C         3-second delay


A,D,E,F,  Ignored (reserved for
future expansion)


(Note:    Digits may be represented
in either ATASCII or BCD.)


For pulse dialing, the controller is
responsible for inter-digit timing.
After dialing each digit, the modem
waits the appropriate inter-digit
time before accepting the next digit.
The controller dials each new digit
as instructed to do so.


For DTMF dialing, the handler is
responsible for timing and
transmission of the DTMF tones by
generating them from POKEY and
transmitting them into the telephone
line.


The end-of-digits characters are
required to terminate each DIAL
DIGITS command.  The handler
interprets each character received as
a digit for dialing until an XB (hex)
character is received.  (Note:
ATASCII EOL, 9B hex, may be the
terminating character.)


It is not required that the user dial
a complete telephone number with one
use of the DIAL DIGITS command.  The
user may use more than one DIAL
DIGITS command to dial a phone
number.  There will be no signal to
the modem of the last digit of the
complete phone number.  The modem
assumes each DIAL DIGITS command may
be the last, and monitors for the
carrier following each command.  The
modem starts a thirty-second time-out
following each end-of-digits command.
If neither another DIAL DIGITS
command nor carrier is detected in
the period, the modem will place the
phone on-hook.


In DTMF dialing mode, the computer
resident handler passes dial tones
directly through the modem, and
terminates the dialing sequence with
the thirty-second timeout "P"
command, causing the wait for carrier
detect and subsequent actions
(establishing line connect or
time-out and going on-hook).


GO OFF-HOOK: (L ASCII, 4C hex, 76
decimal)


The modem takes the phone off-hook.
The modem then monitors for the
carrier (with thirty-second
time-outs.


GO ON-HOOK:  (M ASCII, 4D hex, 77
decimal)


The modem places the phone on-hook
(the default).  This command is used
to terminate dialing, or to terminate
waiting for the carrier following
dialing.


SET PULSE DIALING:  (N ASCII, 4E hex,
78 decimal)


The handler communicates dial digits
commands to the modem for pulse
dialing (the default).


SET TONE DIALING:  (O ASCII, 4F hex,
79 decimal)


The handler performs dial digits
operations itself by suspending
operation of the modem on the SIO
interface, generating the tones using
POKEY, resuming operation of the
modem, and invoking a thirty-second
time-out using the "P" command.


START THIRTY SECOND TIME-OUT: (P
ASCII, 50 hex, 80 decimal)


The modem begins a thirty-second
time-out for detecting a carrier.
This command is used after generating
a tone-dialing sequence from the
computer.  If no carrier is detected
within thirty seconds, the modem
place the telephone on-hook.


        RESET MODEM:  (Q ASCII, 51 hex, 81
decimal)


Reinitializes the modem controller
code.


ENABLE SOUND:  (Ru ASCII, 52 hex, 82
decimal)


Turns sound to T.V. on


DISABLE SOUND:  (S ASCII, 53 hex, 83
decimal)


Turns sound to T.V. off.  (The
default)


DISABLE AUTO-ANSWER:  (T ASCII, 54
hex, 84 decimal)


Turns Auto-Answer mode off. (The
default)


SET ANALOG LOOP:  (W ASCII, 57 hex,
87 decimal)


The Analog Loopback Test is turned
on.


This command is used by an
application with an appropriate
indication to the user as to whether
the test has passed or failed.


CLEAR ANALOG LOOP:  (X ASCII, 58 hex,
88 decimal)


The Analog Loopback Test is turned
off.  This is the default state.


RESUME MODEM OPERATION:  (Y ASCII, 59
hex, 89 decimal)


Communication with the modem is
re-enabled.  This command is used in
conjunction with the SUSPEND command
(see description below) to reallocate
the serial bus for communication with
the modem.  Execution of this command
causes CMCMD to set to zero and fills
DVSTAT through DVSTAT+3 with current
status information.


SUSPEND MODEM OPERATION:  (Z ASCII,
5A hex, 90 decimal)


Communication with the modem is
disabled.  The nature of the serial
bus protocol requires that no other
device may use the serial bus while
the modem is in an active (receiving)
state.  The SUSPEND command, unlike
the CLOSE command, maintains all of
the current modem settings (phone
stays off-hook) including data which
may remain in the user-supplied I/O
buffer.  Upon execution of this
command, the serial bus is
relinquished and the application can
communicate with other peripherals.


While the modem is in the "suspended"
state, only the RESUME MODEM and CIO
CLOSE commands are considered valid
and processed normally by the
handler.  All other operations
requested of the handler return the
CIO error code for invalid command(84
hex, 132 decimal).


Any information received by the modem
over the telephone line while the
modem is "suspended" will be lost.
It is the responsibility of the
applications software to guard
against this possibility (i.e., by
implementing a flow-control
protocol).


Error Handling

Three exceptional conditions may
occur:  Errors in calling on and
controlling the modem;
Communications errors; and
Asynchronous interruption  ([Break]
key and[System.Reset]).  Errors of
the first type always occur as a
result of an I/O call to the modem
handler through CIO. The error
condition is signaled to the
application via a CIO error return.
The second error type includes buffer
overrun, framing errors, parity
errors, and loss of carrier.  These
errors occur during the application
with a CIO error.  Instead, these
errors set internal error flags which
the application may check with the
STATUS command.   (See Section 2, The
Six Standard Input/Output Command
Interfaces.) The third type of error,
[System Reset], results in an open
IOCB to the modem. (See Section 2,
Handler/Operating System Interface.)


Certain errors may occur on any I/O
call to the handler:


          ERROR
FROM

   80 hex (128 dec) [BREAK] key I/O
abort             handler

   85 hex (133 dec) IOCB not open
CIO

   86 hex (134 dec) bad IOCB
specified                CIO

   8A hex (138 dec) timeout (no modem
response)       handler


Error 85 does not occur on OPEN or
STATUS since CIO performs an implicit
temporary OPEN for these operations.
Other errors are specific to certain
I/O calls:

 CALL  ERROR
FROM

 OPEN  81 (129) IOCB already open
CIO

   84 (132) Invalid command (no I/O
direction)           handler

   96 (159) Port (modem) already open
handler

INPUT  83 (131) Write only
handler

   88 (136) EOF (means carrier loss)
handler

OUTPUT  87 (135) Read only
handler

   88 (136) EOF (means carrier loss)
handler

XIO  92 (146) Function not supported
handler

OUTPUT  84 (132) Invalid command (not
recognized)        handler

establish  98 (152) Illegal
user-supplied buffer       handler


[System.Reset] results in the closing
of the modem IOCB.  When the modem
IOCB is closed, any data not yet sent
from the output buffer will not be
sent.  [System.Reset] affects the
file closing by "mashing" the system
to its reset state.  This operation
is described in Section 2,
Handler/Operating System Interface.


Buffer Use


The 256 byte input and 64 byte output
buffer areas allow effective
concurrent operation between the
modem performing full duplex
communications and the 6502 CPU
running an application.  The
application may not, however, use the
serial I/O channel while the modem is
active.  As the modem receives a
communications byte, it interrupts
the 6502.  The modem handler fields
the interrupt and saves the incoming
character in the input buffer.  Data
held in the buffer is subsequently
read by the application via an input
call through CIO to the modem
handler.  Similarly, output data
first goes into the output buffer.
As the modem completes sending each
output byte, it interrupts the 6502
for more data.  The handler takes the
interrupt and gives the next buffered
byte to the modem for transmission.


The modem handler is responsible for
keeping track of the data in the
buffers as the data arrives and is
sent.  Status is maintained by the
handler, keeping track of how much
data each buffer holds at any time.
The application program has access to
this information by PEEKing at it.
Each buffer is circular (a ring),
holding up to one fewer bytes than
the buffer's size.  Each buffer is
accounted for by internal,
user-transparent pointers.  There are
two byte-count bytes which may be
PEEKed at by the application if it
needs to know the quantity of data
backlog.  These counters are located
as follows:


   Location $400   INCNT    Number of
bytes currently in input buffer.


   Location $401   OUTCNT   Count of
bytes currently in output buffer.


   The buffer area is always
formatted the same, even if the modem
is being used for INPUT only or
OUTPUT only.


The applications program may PEEK at
INCNT and OUTCNT to determine the
number of bytes currently in the
input or output buffers.  All other
parts of the buffer area are for
handler use only.  There is no
defined way for the application to
use any of this data.


The output buffer is always 64 bytes
in length.  As soon as data is put
into the output buffer, it is drained
by the handler at the maximum rate of
the modem until the buffer is
emptied.  Should the buffer fill, the
handler loops for space, waiting for
the modem, and returns to the
application through CIO only when the
byte is placed in the buffer.  If the
application does not wish to be held,
it will have to check the buffer use
before making the output request.

The input buffer is 256 bytes in
length.  It is drained by the
application as fast as the
application can handle the data,
until the buffer empties.  When the
handler is drained, it loops and
waits for data from the  modem.  If
the application does not wish to be
held, it will check the buffer use
before making the input request.
Should the buffer overflow, an error
flag will be set which may be
interrogated by the STATUS command.
(See Section 2, The Six Standard
Input/Output Command Interfaces.)
Input buffer overflow indicates that
data is lost.  The handler retains
the data in the buffer and discards
the new data from the modem.


Handler/Operating System Interface


The handler interfaces to the
Operating System in the following
ways:  Initialization (cold start);
System reset (warm start); Break key
flag; Interrupt handling (IRQ);
System vertical blank timer, and CIO
(including the "put byte" call by
which the application bypasses CIO).
There are also a number of fixed
bytes/words in the Operating System
RAM area reserved for use by the
modem module handler.


Calling interfaces between the
application and the CIO, and between
the CIO and any handler, is described
in the ATARI Home Computer System
Technical Reference Notes. In
addition to operating under CIO
access, the handler supports the PUT
BYTE entry made by 8K BASIC directly
(bypassing CI).  BASIC enters PUT
BYTE with the A, X, and Y registers
as set by CIO. However, the zero page
IOCB is not established (except
ICAX1Z and ICAX2Z), and any checking
normally done by CIO is bypassed and
performed by the handler.


The handler monitors the System
Break key flag (BRKKEY) whenever
executing any loop which either
continues indefinately(as when
waiting for the modem where there is
a possibility the modem may not
respond), or whenever the loop may
exceed one second.  If the [Break]
key is detected, the handler returns
to the caller with Error 80(hex).
(See Section 2, Error Handling.)


The handler/modem interface is
designed so that pressing the [Break]
key does not produce any undesirable
side effects. (Preferably, the modem
should abort an operation when the
[Break] key is pressed at the same
time as the handler aborts.)


The handler includes code for
fielding the IRQs which are generated
by the modem.  The handler's
interrupt code address is installed
in the Operating System RAM vectors
(Serial Input Ready, Serial Output
Read, Serial Output Complete) when
the modem is OPENed or, subsequent to
OPEN, when the modem operation is
RESUMEd.  The handler contains a
special serial bus driver for the
modem.  When the modem is CLOSEd or
SUSPENDed the handler reinstalls the
Operating System RAM interrupt vector
for Serial Input Ready.


The power-on default conditions are
as follows:  All errors are cleared;
translation and parity controls are
set to zero; and the Analog Loopback
Test is off.


The effect of a warm-start
([System.Reset]) is to close any file
open to the modem and to reinitialize
the handler and modem to the
power-on.

VAUGHAN@CANISIUS.BITNET (Tom Vaughan @ Computer Center) (11/23/87)

begin 666 HANDLER.OBJ
M__\ 'OL>J1[M'A<@#A~F(+8@3! > *F8C><"J2B-Z (@/"<@?R2@_XQ"!(Q2y
M!(Q/!*U0!$C(C% $(*HC:(U0!*4(\ VI$(U"!*($CD\$(-PCJ0"HF0 $R!#Zy
MJ5&-0@2-4@2-3P0@JB,@&R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