[Addressed Listing] [Alphabetical Listing] [Error Codes]

CHKIN

     Purpose:  Open a channel for input
Call address:  $FFC6 (hex)  65478 (decimal)
Communication registers:  X
Preparatory routines:  (OPEN)
Error returns:  3, 5, 6
Stack requirements:  None
Registers affected:  A, X

Description:

Any logical file that has already been opened by the KERNAL OPEN routine can be defined as an input channel by this routine. Naturally, the device on the channel must be an input device. Otherwise an error will occur, and the routine will abort.

If you are getting data from anywhere other than the keyboard, this routine must be called before using either the CHRIN or the GETIN KERNAL routines for data input. If you want to use the input from the keyboard, and no other input channels are opened, then the calls to this routine, and to the OPEN routine are not needed.

When this routine is used with a device on the serial bus, it automatically sends the talk address (and the secondary address if one was specified by the OPEN routine) over the bus.

How to Use:

  1. OPEN the logical file (if necessary; see description above).
  2. Load the X register with number of the logical file to be used.
  3. Call this routine (using a JSR command).

Possible errors are:

EXAMPLE:

     ;PREPARE FOR INPUT FROM LOGICAL FILE 2
     LDX #2
     JSR CHKIN

[Addressed Listing] [Alphabetical Listing] [Error Codes]