Purpose: Open a channel for input
Call address: $FFC6 (hex) 65478 (decimal)
Preparatory routines: (OPEN)
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 auto- matically sends the talk address (and the secondary address if one was specified by the OPEN routine) over the bus.
How to Use:
Possible errors are:
#3: File not open #5: Device not present #6: File not an input file
;PREPARE FOR INPUT FROM LOGICAL FILE 2 LDX #2 JSR CHKIN