Index

Function Name: OPEN

Purpose: Open a logical file
Call address: $FFC0 (hex) 65472 (decimal)
Communication registers: None
Preparatory routines: SETLFS, SETNAM
Error returns: 1,2,4,5,6,240, READST
Stack requirements: None
Registers affected: A, X, Y

Description: 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 KERNAL 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 KERNAL routines must be called before using this routine.

How to Use:

  1. Use the SETLFS routine.
  2. Use the SETNAM routine.
  3. Call this routine.

EXAMPLE:
This is an implementation of the BASIC statement: OPEN 15,8,15,"I/O"

         LDA #NAME2-NAME       ;LENGTH OF FILE NAME FOR SETLFS
         LDY #>NAME         ;ADDRESS OF FILE NAME
         LDX #<NAME
         JSR SETNAM
         LDA #15
         LDX #8
         LDY #15
         JSR SETLFS
         JSR OPEN
   NAME  .BYT 'I/O'
   NAME2