Index

Function Name: CHKOUT

Purpose: Set output channel
Call address: $FFC9 (hex) 65481 (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, DFLTO
			STATUS, RSSTAT updated
	Flags:		.C = 1 -> error

Description: CHKOUT establishes an output channel to the device associated with the logical address (LA) passed in .X, in preparation for a call to BSOUT. The Kernal variable DFLTO ($9A) is updated to indicate the current output 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). CKOUT performs certain device specific tasks: keyboard channels are illegal, screen channels pass through, cassette files are confirmed for output, and serial channels are sent a LISTN command and the SA transmitted (if necessary). Call CLRCH to restore normal I/O channels.
CKOUT is required for all output except the screen. If screen output is desired and no other output channel is established, you do not need to call CKOUT or OPEN. The screen is the default output device for BSOUT.
The path to CKOUT is through an indirect RAM vector at $320. Applications may therefore provide their own CKOUT procedures or supplement the system's by redirecting this vector to their own routine.

EXAMPLE:

	LDX	#1	;la
	JSR	$FFC9	;CHKOUT
	BCS	error