!TITLE Input/Output Facilities !KEY Input/Output (I/O) facilities are provided to enable programs to read data from files or input devices, and send data to files or output devices. These facilities take the form of standard procedures, described below. (As explained in Section 7, standard procedures do not require to be specified before use; they are defined implicitly). All the procedures described refer to logical I/O channels to which numbers in the range 0-99 have been assigned. In some implementations certain channel numbers are reserved for system use. {EMAS IMP80: channels 0 and 81-99 are reserved for system defined devices. Channel numbers in the range 1-80 can be used for purposes defined by the user, subject only to the rule that a channel number can only refer to one channel at a time.} {IMP77: input channel n and output channel n are logically distinct.} Each implementation of the language provides facilities for linking these logical channels to particular files or I/O devices; refer to the relevant User Guide for information on this subject. !PAGE The primary I/O facilities in IMP use character information, that is, information that can be represented as sequences of characters. All the routines and functions use an Internal Character Code based on the ISO Code for the interchange of data (see Section 1). Some implementations of IMP may use other codes. Facilities are also provided to handle binary information, as a direct copy of the representation of values in the computer store. Two types of binary I/O are provided: Sequential Access for use when data is accessed (read or written) in the order in which it is held in the store, and Direct Access for use when data is accessed randomly from the store. All the binary I/O routines and functions are explicit, and so must be declared in each program in which they are used (see Section 5.2). !