392 10 MODE2 20 COLOUR 9 30 A%=9 40 X%=10:Y%=0 50 CALL(&FFF4) Obviously, this is far more ponderous than simply typing *FX9,10 , and indeed the CALL BASIC keyword is mainly used in conjunction with assembly language programs (see chapter 45). A far more powerful method of making operating system calls is through use of the USR BASIC keyword. The above program could be re-written as 10 MODE2 20 COLOUR 7 30 A%=9 40 X%=10:Y%=0 50 PRINT ~USR(&FFF4) (Note that the foreground colour has been changed to white – it’s a little difficult to read the output of this program in flashing red/cyan!).
The effect of line 50 is to set the duration of the first flashing colour as before (which can be confirmed by using COLOUR to select a flashing colour combination), and also to print the following on the screen: 30191909 The string of figures are hexadecimal digits, which have come from registers in the 6512. They have the following meanings (reading from right to left): 09 This has come from register A (the accumulator), which was set up from A% (it is simply the OSBYTE call number; all OSBYTE calls preserve A). 19 This has come from the X register, and is the previous colour duration value. In this case the previous value is the default value, 25.
(Remember the digit pairs are hexadecimal, &19=25 decimal). 19 This has come from the Y register, and contains the same value as the X register. 30 This has come from the P register (the program status register, mainly of interest to those programming in assembly language). Of course, all OSBYTE calls do not have the same exit conditions. The next example performs a totally different function. Note also that the result of the USR call has been assigned to a set of variables, so that it can be printed out in a more readable form: