This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

OPEN

Open a logical file

Table of Contents

Function AddressVectorDescription
OPEN FFC0031AOpen a logical file

This routine is used to OPEN a logical file. Once the logical file is set up, it can be used for input/output operations.

Most of the I/O routines call on this routine to create the logical files to operate on. No arguments need to be set up to use this routine, but both the SETLFS and SETNAM routines must be called before using this routine.

Example:
openFileEquivalent of Basic: OPEN 15,8,15,"I/O"
LDA#filenameEnd-filenameLength of filename
LDX#<filenameAddress of filename
LDY#>filename
JSRSETNAMSet filename
LDA#15Logical file number
LDX#8Device number, 8 = disk
LDY#15Secondary address
JSRSETLFSSetup logical file
JMPOPENOpen the logical file
filenameEQUS"I/O"Filename
filenameEnd