$90/144: Kernal I/O Status Word ST +-------+---------------------------------+ | Bit 7 | 1 = Device not present (S) | | | 1 = End of Tape (T) | | Bit 6 | 1 = End of File (S+T) | | Bit 5 | 1 = Checksum error (T) | | Bit 4 | 1 = Different error (T) | | Bit 3 | 1 = Too many bytes (T) | | Bit 2 | 1 = Too few bytes (T) | | Bit 1 | 1 = Timeout Read (S) | | Bit 0 | 1 = Timeout Write (S) | +-------+---------------------------------+ (S) = Serial bus, (T) = Tape Value of ST variable, device status for serial bus and datasette input/output Serial bus bits: Bit #0: Transfer direction during which the timeout occured; 0 = Input; 1 = Output. Bit #1: 1 = Timeout occurred. Bit #4: 1 = VERIFY error occurred (only during VERIFY), the file read from the device did not match that in the memory. Bit #6: 1 = End of file has been reached. Bit #7: 1 = Device is not present. Datasette bits: Bit #2: 1 = Block is too short (shorter than 192 bytes). Bit #3: 1 = Block is too long (longer than 192 bytes). Bit #4: 1 = Not all bytes read with error during pass 1 could be corrected during pass 2, or a VERIFY error occurred, the file read from the device did not match that in the memory. Bit #5: 1 = Checksum error occurred. Bit #6: 1 = End of file has been reached (only during reading data files).
The Kernal routines which open I/O channels or perform input/output functions check and update this location. The value here is almost always the same as that returned to BASIC by use of the reserved variable ST. Note that BASIC syntax will not allow an assignment such as ST=4. A table of status codes for cassette and serial devices follows below:
Bit BitValue Cassette 2 4 Short Block 3 8 Long Block 4 16 Unrecoverable error (Read), mismatch 5 32 Checksum error 6 64 End of file Bit BitValue Serial Devices 0 1 Time out (Write) 1 2 Time out (Read) 6 64 EOI (End or Identify) 7 128 Device not present
Probably the most useful bit to test is Bit 6 (end of file). When using the GET statement to read in individual bytes from a file, the statement IF ST AND 64 will be true if you have got to the end of the file. For status codes for the RS-232 device, see the entry for location 663 ($0297).
Kernal-Reference:
AND $90 : $F4F5
BIT $90 : $EE79 $F249 $F28A $F524
LDA $90 : $F1AD $F3ED $F4DA $F505 $F55D $FE1A
ORA $90 : $FE1C
STA $90 : $F311 $F3DF $F4A9 $F4F7 $F843 $FE1E
Previous Page / Next Page