11 Vectors Filing systems must provide a series of seven vectors when selected. These vectors point to relevant routines within the filing system. The filing system vectors are: &212 FILEV Operations on whole files &214 ARGSV Read/write file ar guments &216 BGETV Get one byte from an open file &218 BPUTV Put one byte to an open file &21A GBPBV Get/put a block of bytes to/from an open file &21C FINDV Open/close a file for byte access &21E FSCV Various filing system control actions The HDFS supports all of the filing system vectored operations, with a few restrictions. Some extended operations are also provided; these are marked *. All of the addresses and file lengths in the parameter blocks are specified least significant byte first. 11.1 OSFILE Call address &FFDD, indirected through &212. On entry, X and Y point to a parameter block in memory (X low byte, Y high byte) The format of the parameter block is: 00 01 Address of the filename, terminated by RETURN (&0D) 02 03 04 05 Load address of the file 06 07 08 09 Execution address of the file 0A 0B 0C 0D Start address of data for save, length of file otherwise 0E 0F 10 11 End address of data for save, file attributes otherwise The accumulator contains a number indicating the action to be performed: A=&FF Load the named file at the address given in the parameter block if the least significant byte of the execution address (XY+6) is zero. If this byte is not zero, load the named file at its own load address. A=0 Save a block of memory using the name and addresses given in the parameter block. A=1 Change the attributes, load and execution addresses of the named (existing) file. A=2 Change the load address of the named file only. A=3 Change the execution address of the named file only. A=4 Change the attributes of the named file only. A=5 Read the attributes, load and execution addresses, and length of the named file into the parameter block. A=6 Delete the named file. A=7 * Create a catalogue entry for the named (non-existent) file, with the attributes, load and execution addresses, and length supplied. A check is made to ensure that the length does not exceed the space available for the file. No data is written to the file. A=8 * Create a new directory with the given name, attributes, addresses, and length supplied. The load and execution addresses are written to the catalogue, but are not actually used for anything. A check is made to ensure that the length does not exceed the space available for the file. A new catalogue is initialised in the directory. A=9 * Change the length of the named (existing) file. A check is made to ensure that the new length does not exceed the space available for the file. A=10 * Change the attributes, load and execution addresses, and length of the named file. A check is made to ensure that the new length does not exceed the space available for the file. Only the least significant byte of the attributes is used, for the file permissions. There are two bits for each attribute; if either of the bits are set, the attribute is set. Bit Bit Meaning 0 4 Not readable 1 5 Not writable 2 6 Not executable 3 7 Not deletable On exit, the file type is returned in the accumulator: 0 Nothing found 1 File found 2 Directory found X and Y are preserved. C, N, V , and Z are undefined. 11.2 OSARGS Call address &FFDA, indirected through &214. On entry, X points to a four byte zero page control block. Y contains a file handle (as provided by OSFIND) or zero. The accumulator contains a number specifying the action required: Y=0: A=&FF All open files are updated to disc if necessary. A=0 The current filing system number is returned in the accumulator. The filing system number for HDFS is 4. A=1 The address of the rest of the command line is returned in the zero page control block, giving access to parameters passed by *RUN or * command. The command line is always in the I/O processor memory. Y<>0: A=&FF Update the file to disc if necessary. A=0 Read the sequential pointer of the file into the zero page control block. A=1 Write the sequential pointer of the file from the zero page control block. If the file is opened for writing or update, and the new pointer is greater than the length for the file, the file is extended and filled with zero data bytes to the required length. A=2 Read the length of the file into the zero page control block. A=3 * Read the maximum length that the file can reach into the zero page control block. It may be possible to make more space for the file by shuffling other files around. On exit, X and Y are preserved. The accumulator is preserved, except when reading the filing system type. C, N, V , and Z are undefined, and D is cleared. 11.3 OSBGET Call address &FFD7, indirected through &216. On entry, Y contains the file handle, as provided by OSFIND. A byte is read from the point in the file designated by the sequential file pointer. On exit, X and Y are preserved. The accumulator contains the byte read. C is set if the end of file has been reached, and indicates that the byte obtained is invalid. N, V, and Z are undefined. 11.4 OSBPUT Call address &FFD4, indirected through &218. On entry, Y contains the file handle, as provided by OSFIND. The accumulator contains the byte to be written to the file. The byte is written at the point in the file designated by the sequential file pointer. On exit, X, Y, and A are preserved. C, N, V , and Z are undefined. 11.5 OSGBPB Call address &FFD1, indirected through &21A. On entry, X and Y point to a control block in memory (X low byte, Y high byte) The control block format is: 00 File handle 01-04 Address of the data 05-08 Number of bytes to transfer 09-0C New sequential pointer to be used for transferring data The accumulator contains a number indicating the action to be performed: A=1 Put bytes to disc, using the new sequential pointer A=2 Put bytes to disc, ignoring the new sequential pointer A=3 Get bytes from disc, using the new sequential pointer A=4 Get bytes from disc, ignoring the new sequential pointer A=5 Get the disc title and boot up option. The data returned is in the format: 00 Length of the title, n 01 Disc title 01+n Boot up option The boot option is the value that was set with *OPT (see section 11.7). 02+n A=6 Read the current directory and device. The data returned is in the format: 00 1 (Length of drive number) 01 Drive number 02 Length of current directory name, n 03 Current directory name 03+n A=7 Read the current library name and device. The data is returned in the same format as the current directory (A=6). A=8 Read file names from the current directory. The control block is modified, so that the file handle byte contains the cycle number or directory key, and the sequential pointer is adjusted so that the next call with A=8 will get the next file name. The number of bytes to be transferred is interpreted as the number of file names to read; for the first call, the sequential pointer should be zero. The data is returned in the format: 00 Length of filename 1, n1 01 Filename 1 01+n1 Length of filename 2, n2 02+n1 Filename 2 02+n1+n2 ...etc A=9* Get spaces from the current directory. The data returned is in the format: 00-01 Start sector of gap 1 02-03 Length in sectors of gap 1 04-05 Start sector of gap 2 06-07 Length in sectors of gap 2 etc... On exit, X, Y and the accumulator are preserved. N, V, and Z are undefined. The C flag set if the end of the file has been reached, or if there are no more file names or gaps to read. In this case, the number of bytes, names or gaps which have not been transferred are written back to the parameter block. The address field and sequential pointer are always adjusted to point to the next byte to be transferred. 11.6 OSFIND Call address &FFCE, indirected through &21C. On entry , the accumulator specifies what action is to be performed: A=0 A file is to be closed: Y=0 Close all files, Y<>0 Y contains the file handle of the file to close. A<>0 A file is to be opened. X and Y point to the file name (X low byte, Y high byte) The file name is terminated by RETURN (&0D) The accumulator indicates what type of access is required: A=&40 The file is to be opened for input only A=&80 The file is to be opened for output only. If a file with the same name exists, an attempt is made to delete it before opening for output. A=&C0 The file is to be opened for update (input and output) The file will not be created if it does not exist. On exit, X and Y are preserved. The accumulator is preserved on closing, and on opening contains the file handle assigned to the file. If the accumulator is zero on exit, the file could not be opened. C, N, V, and Z are undefined. 11.7 FSCV No direct address to FSCV, indirect access is through &21E. On entry, the accumulator contains a number specifying what action is to be performed: A=0 Perform a *OPT command; X and Y are the two parameters. The value of X determines what action is taken: X=0 Restore default values. The defaults values are: X Value Meaning 1 0 No filing system messages 2 5 Number of retries 3 &F Sideways ROM socket X=1 Turn on filing system messages. The value of Y determines the amount of information given: Y=0 Turn off filing system messages Y=1 File name and permissions are displayed Y=2 File name, addresses, length and permissions are displayed. If filing system messages are turned on, they are displayed on most OSFILE and OSFIND operations, and by some other commands as well. X=2 The value of Y is the number of retries made before giving up when a disc error is detected. X=3 The value of Y is the ROM socket to be used when loading and saving to I/O processor addresses in the range &8000-&BFFF. X=4 The auto-boot option of the current directory is set according to the value of Y: Y=0 No action Y=1 *LOAD !BOOT Y=2 *RUN !BOOT Y=3 *EXEC !BOOT A=1 Check whether end of file (EOF) has been reached. On entry X is the file handle to be checked. On exit, X is &FF if EOF has been reached, and zero if EOF has not been reached. A=2 A */ command has been used. The command whose name follows the '/' character will be *RUN. A=3 An unrecognised operating system command has been used. HDFS will check the command against its own filing system commands first, and then try to *RUN the command if it is not found. On entry X and Y point to the command line (X low byte, Y high byte). A=4 A *RUN command has been issued. The file name pointed to by X and Y (X low byte, Y high byte) will be loaded and executed. As a special case, if the execution address of the file is &FFFFFFFF, the file will be *EXECed instead. A=5 A *CAT command has been used. X and Y point to the rest of the command line. A=6 Shut down HDFS because a new filing system is taking over. A=7 The lowest and highest possible file handles used are returned in X and Y. HDFS uses the range &12-&17. A=8 This call is used whenever an operating system command is about to be processed. It is used by DNFS to implement the *ENABLE flag. HDFS takes no action on this entry.