I/O Handling 163 System File Information As an ASSIGN statement is executed in BASIC, a file-descriptor is created for that assignment in the operating system's files table. The ASSIGN statement essentially has two parameters - the file number and the file name (including the BASIC language mass storage unit specifier). The file number is, for all practical purposes, an offset into the files table. The file name and the BASIC language mass storage unit specifier are translated and the critical information as- sociated with them comprise an entry in the files table (Le., the "file descriptor").
The file descriptor consists of 10 words containing the following information - Word Description o Lower 16 bits of the address of the first physical record in the file 1 Number of logical records in the file 2 Current physical record number (Le., an offset from the file's beginning. 4 Size of a logical record (in words) 3 Current word in physical record 5 Mass storage unit specifier (msus) 6 Buffer address 7 Check read status (0 = off, 1 = on) 8 Highest 7 bits of the first physical record in the file 9 (Reserved by the operating system) Note that words 0,5 and 7 contain the information necessary to create an MSD.
You may access a file descriptor through two utilities - Get_file_info to obtain the information, and Put_file _info to change the information. NOTE A files table is created for each BASIC "environment" (Le., main program and subprograms). When access is made through utilities to the files table, the table accessed is the one associated with the BASIC environment which called the assembly language program.