Micropower |
Volume 2 · Number 1 · February 1982 |
Page 31 of 37 |
---|
For the same reason, a line feed (code £0A) is output after a carriage return (£0D), as most systems need both signals; however, the line feed can be suppressed by setting bit 4 of the option byte. The Nas-Sys 1 external output routine ignores nulls, but Nas-Sys 3 has been modified so that nulls are output correctly.
The many options available make this a very powerful command. Because the user output routine is automatically brought into operation when the X command is invoked, you can have a parallel printer on line in addition to the Nascom keyboard and an ASCII terminal (for example, a teletype keyboard and printer). Of course, you must set up the user output routine by storing the address at £0C78 in the usual way.
In Nas-Sys 1, Y produces an error message – the address in the subroutine table is £030A. Nas-Sys 3 uses Y to jump to £B000; this will normally be used to access software in an EPROM at this address, such as the Basic ‘Programmer’s Aid’ or an extension to the monitor. I have the initialisation routine for my printer here, so that Y configures the PIO ports, clears the print buffer and resets the printer options.
This command is normally used to ‘warm start’ the Microsoft Basic at £FFFD. Of course, if you haven’t got the Basic in ROM you can use the command to access other software by changing the address stored for the Z command. I use it to access Zeap, using Z for a warm start and ZC for a cold start. Because C is a valid hexadecimal number, you can use it as an argument to a command. The software at the start of the command tests the value in the L register; if it is £0C, it does a jump to the cold start address, otherwise it does a warm start. This has two advantages. Firstly, it gives you two commands for the price of one – when you start modifying your software you soon run out of command letters. Secondly, it reduces the chance of performing a cold start when you meant a warm start; it still happens, but not as often. There always seems to be room in the software you are accessing for the extra code needed to test the value of ARG1.
However, there is a snag. I tried the same system for Basic, using J for a warm and JC for a cold start. I then found that I couldn’t RUN programs that appeared to CLOAD correctly. On LISTing garbage was displayed. The reason was that the argument C was used as an offset in the Nas-Sys 3 READ routine used by CLOAD – the program was being read in to an address twelve bytes higher than the correct address.
Page 31 of 37 |
---|