* Module: ISFILEOPEN
*
* Date: January 16, 1995
*
* Author: David Nieters
*
* Modifications:
*   April 18, 1995 - Changed the size of a file entry to
*                    100 blocks to allow for expansion

* IFO - Is File Open
*
* This routine will check to see if the file name specified in
* the name compare buffer has been opened.  The SCSI ID is
* contained in MSB of the caller's R6.  If the file is open,
* it will set the equal bit in the caller's status register.
* It also sets the caller's registers as follows -
*
*    R5 = Pointer to open file cache entry
*
* Note: RAM bank 2 must be enabled before calling this routine
*


IFO    DATA IFOWS
       DATA IFO1

IFO1   LI   R9,>0600     Starting bank of data buffer
       LI   R8,>5000     Starting address of FDRs
       LI   R2,16        Maximum possible number of open files
       LI   R3,OFCASH    Set to beginning of open file cache

IFO3   MOV  @4(R3),R0
       JEQ  IFONXT            Go to next file if this one is not open
       CB   *R3,@12(R13)      Comapre SCSI ID
       JNE  IFONXT            Go to next file if SCSI IDs don't match

       MOV  R3,R4
       AI   R4,8
       LI   R5,NCB       Point R4 at full file name
       LI   R6,40        Maximum file name length
IFO2   C    *R4+,*R5+
       JNE  IFONXT
       DECT R6
       JNE  IFO2

       MOV  R3,@10(R13)       We have a match!
       SOC  @EQBIT,R15        Set equal status bit
       RTWP


IFONXT
       AI   R3,100            Go to next entry in Open File Cache
       DEC  R2
       JNE  IFO3              Check next entry
       SZC  @EQBIT,R15        Clear equal status bit
       RTWP                   and return
