Index

Function Name: CHKIN

Purpose: Set input channel
Call address: $FFC6 (hex) 65478 (decimal)
Preparation:

	Registers:	.X = LA (logical #)
	Memory:		system map
	Flags:		none
	Calls:		OPEN
Results:
	Registers:	.A = error code (if any)
			.X used
			.Y used
	Memory:		LA, FA, SA, DFLTN
			STATUS, RSSTAT updated
	Flags:		.C = 1 -> error

Description: CHKIN establishes an input channel to the device associated with the logical address (LA) passed in .X, in preparation for at call to BASIN or GETIN. The Kernal variable DFLTN ($99) is updated to indicate the current input device and the variables LA, FA and SA are updated with the file's parameters from its entry in the logical file tables (put there by OPEN). CHKIN performs certain device specific tasks: screen and keyboard channels pass through, cassette files are confirmed for input, and serial channels are sent a TALK command and the SA transmitted (if necessary). Call CLRCHN to restore normal I/O channels.
CHKIN is required for all input except the keyboard. If keyboard input is desired and no other input channel is established, you do not need to call CHKIN or OPEN. The keyboard is the default input device for BASIN and GETIN.
The path to CHKIN is through an indirect RAM vector at $31E. Applications may therefor provide their own CHKIN procedure or supplement the system's by redirecting this vector to their own routine.

EXAMPLE:

	LDX	#1	;la
	JSR	$FFC6	;CHKIN
	BCS	error