449 On exit A, X and Y are preserved, C, N, V and Z are undefined and D = 0. The interrupt state is preserved. OSNEWL This call issues an LF CR (line feed, carriage return) to the currently selected output stream. The routine is entered at &FFE7. On exit X and Y are preserved, C, N, V and Z are undefined and D = 0. The interrupt state is preserved. OSWRCH This call writes the character in A to the currently selected output stream. The output stream may be changed using an OSBYTE call with A=3. See chapter 43 for more details. OSWRCH is entered at location &FFEE and indirects via &20E. On exit A, 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. All character output from BASIC, the operating system and anything else uses this routine. It is, therefore, easy to pass all output to a user provided output routine by placing the address of the user routine at WRCHV (&20E). However, the user should note that all control characters have special significance. For example, &1C is followed by four bytes which define a text window. See chapter 34 on VDU codes for a complete listing of control characters. If the user wishes to intercept any control characters then his or her routine must check for all control characters.
The routine must arrange to skip however many bytes follow a particular code since these bytes might, inadvertently, contain a control code. For example, the BASIC statement GCOL 1,3 is passed to the operating system as a string of bytes through OSWRCH. In fact, in this case the bytes would be &12,1,3. OSWORD The OSWORD routine invokes a number of miscellaneous operations all of which require more parameters or produce more results than can be passed in A, X and Y. As a result, all OSWORD calls use a parameter block somewhere in memory. The exact location of the parameter block is given in X (low byte) and Y (high byte). The contents of A determine the exact nature of the OSWORD call.
All OSWORD calls are entered at location &FFF1 which indirects through &20C. The table below summarises the OSWORD calls.