C.2 1/0 Handling The approach used in the TI-99/4A Home Computer File Management System has been that all devices should look the same to an application program. Therefore when peripherals are added to the computer, it should not affect the BASIC inlerpreter. Only the peripheral driver (Device Service Rouline, or DSR) will have to be added to the software. All peripherals for the TI1-99/4A Home Computer, with the exception of the keyboard/display, are considered equivalent by an application program, within physical limitations (reading data from a thermal printer is clearly impossible). These physical limitations are determined in the device service routine and returned to the application program as an error condition. The TI-99/-4A Home Computer File Management System supports both random and sequential access files. Both file types use the same supervisor call mechanism in order to insure a high degree of device independence. Hardware devices (such as a line printer) are accessed as sequential files except that no file name is appended to the device name. The following sections describe the file structures available to the BASIC interpreter, how to create and delete files, and how to perform file 1/0. Two different kind of file organizations are supported: o Sequential files o Relative record files (random access) C.2.1 Tile Organization and Use The following paragraphs discuss the file organization and use for each of the two file types. C.2.1.1 Sequential Files Sequential files are both used for disk-based files and for I/0 to other devices. They consist of fixed or variable record length files whose records are always accessed serially, like the output to the thermal printer. C.2.1.2 Relative Record Files Relative record files are also called random access files because, unlike a sequential file, records may be accessed in an arbitrary order. Therefore relative record files can only be supported on random access media such as floppy disks. 34 a . : a