448 Bit Meaning 0 Not readable by you 1 Not writable by you 2 Not executable by you 3 Not deletable by you 4 Not readable by others 5 Not writable by others 6 Not executable by others 7 Not deletable by others File types are as follows: 0 Nothing found 1 File found 2 Directory found A BRK will occur in the event of an error and this can be trapped if required. See ‘Faults, events and BRK handling’ towards the end of this chapter. On exit X and Y are preserved, C, N, V and Z are undefined and D=0. The interrupt state is preserved but interrupts may be enabled during the operation. OSRDCH This routine reads a character from the currently selected input stream into A.
The routine is called at location &FFE0 and indirects via &210. The input stream can be selected by an OSBYTE call with A=2. See chapter 43. On exit C=0 indicates a successful read and the character will be in A. C=1 indicates an error and the error type is returned in A. If C=1 and A=&1B then an escape condition has been detected and the user must at least acknowledge this by performing an OSBYTE call with A=&7E; BASIC will normally do this for you. X and Y are preserved, N, V and Z are undefined and D=0. The interrupt state is preserved. OSASCI This routine writes the character in A to the currently selected output stream by using OSWRCH.
However, if A contains &0D then OSNEWL is called instead. The actual code at location &FFE3 is FFE3 C9 0D OSASCI CMP #&0D FFE5 D0 07 BNE OSWRCH FFE7 A9 A0 OSNEWL LDA #&0A FFE9 20 EEFF JSR OSWRCH FFEC A9 0D LDA #&0D FFEE 6C 0E02 OSWRCH JMP (WRCHV)