Index

Function Name: LKUPLA

Purpose: Search tables for given LA
Call address: $FF59 (hex) 65369 (decimal)
Preparation:

	Registers:	.A = LA (logical file number)
	Memory:		system map
	Flags:		none
	Calls:		none
Results:
	Registers:	.A = LA (only if found)
			.X = FA (only if found)
			.Y = SA (only if found
	Memory:		none
	Flags:		.C = 0 if found
			.C = 1 if not found

Description: LKUPLA is a Kernal routine used primarily by BASIC DOS commands to work around a user's open disk channels. The Kernal requires unique logical device numbers (LA's), and the disk requires unique secondary addresses (SA's); therefore BASIC must find alternative unused values whenever it needs to establish a disk channel.

EXAMPLE:

	LDY	#$60	;find an available SA
AGAIN	INY
	CPY	#$6F
	BCS	TOO_MANY;too many files open
	JSR	$FF5C	;LKUPSA
	BCC	AGAIN