Read a character from the input file.
Read a character from the input stream. Fetches blocks from tape as required.
No conditions.
If the character was read OK:
Carry true.
Zero false.
A contains the character read from the file.If the end of the file was found:
Carry false.
Zero false.
In V1.1: A contains an error number (#0E or #0F).
In V1.0: A corruptIf the user hit escape:
Carry false.
Zero true.
In V1.1: A contains an error number (#00).
In V1.0: A corruptAlways:
IX and other flags corrupt.
All other registers preserved.
This routine can return three error numbers:
- #00: The user hit escape.
- #0E: The stream is not open for reading or the user hit escape previously.
- #0F: Have reached the end of the file.
Once the first character has been read from a file it can only be used for character by character access. It is not possible to switch to direct reading (by CAS IN DIRECT).
CAS IN CHAR (DISC)
CAS IN CLOSE
CAS IN DIRECT
CAS IN OPEN
CAS OUT CHAR
CAS RETURN
CAS TEST EOF
Read a character from the input file.
Read a character from the input stream.
No conditions.
If the character was read OK:
Carry true.
Zero false.
A contains the character read from the file.If the end of the file was found, or stream not open as expected:
Carry false.
Zero false.
A contains an error number (#0E, #0F or #1A).If failed for any other reason:
Carry false.
Zero true.
A contains an error number.
IX and other flags corrupt.
All other registers preserved.
Once the first character has been read from a file the rest of the file may only be read character by character (using CAS IN CHAR), It is not possible to switch to direct reading (by CAS IN DIRECT).
The CP/M end of file character (#1A) is treated as end of file (carry false, zero false). However, it is possible to continue reading characters until the hard end of file. The error number returned is set to #1A for soft (CP/M) end of file and #0F for hard end of file. The action of spotting soft end of file is not performed by the equivalent cassette version of the routine and it will never return #1A when carry is false.
If a file containing binary data is read using this routine then it will be necessary to spot soft EOF and ignore it.
CAS IN CHAR (TAPE)
CAS IN CLOSE (DISC) CAS OUT CHAR (DISC)
CAS IN DIRECT (DISC) CAS RETURN (DISC)
CAS IN OPEN (DISC) CAS TEST EOF (DISC)