A Polydos Version Of NasPen
By Alan Melia
Because many Nascom users, who, like myself, started with cassette
systems, would have bought and installed NASPEN, it was felt that a Polydos
compatible version might be more acceptable than a change to say Polytext.
Personally, being mean, and having spent my pocket money for this month, I
wanted to get my cassette text files onto this excellent disk operating
system. The advantage of Polydos is a good manual, with some very useful
examples of how to use the PolyDos subroutines, and a relatively simple guide
to producing purpose-built file-handling overlays. Armed with these tools and
a trusty Nasdis listing of my Naspen, I set to work to try and produce a
usable system.
First Naspen was copied to disk, and the ROM was removed to leave RAM at
B000 to BFFF. A careful investigation of the Nasdis listing showed that the
NASPEN command decoding table started at B999H. The table consisted of a three
byte entry for each command, the table being terminated by a catch-all jump to
a ‘command error’ subroutine.The first byte is the ASCII value of the command
symbol,the second and third give the address of the routine to execute the
command (bytes reversed, of course). I determined to reallocate the “R” and
“W” commands to the new disk routines to retain some compatibility with the
original usage. I further decided that I required to keep the cassette
routines to retain compatibility with several other local ‘Nascomaniacs’. A
skim through the handbook for Naspen will confuse by offering duplicate
commands for cursor-up and cursor-down, “+ & –” as well as the normal cursor
keys. Thus I determined to replace the “+ & –” with commands “r & w” for
cassette read and write, and altered the “R & W” entries in the table to point
to the new disk routines in the overlay. This means that only a simple patch
is required, rather than a full re-assembly job. A further modification that
was found necessary was to re-program the “return to Nas-sys”. The original
Naspen return reinitialises Naspen by jumping to 0000H rather than that well-loved
line, DF 5B. Unfortunately it was not sufficient to add the “DF 5B”
code, as the rentry to PolyDos leaves the keyboard in “typewriter” mode. So a
few more bytes of code were required to reset “K0”. First, a seperate file
was written and debugged. This file contained the code nessessary to access
the PolyDos routines, and had to be loaded before Naspen was called. The ploy
worked quite well, but flushed with success, I decided that it would be far
tidier if the extra file was loaded automatically when Naspen was called. The
proceedure used was to rename Naspen with an extension “NP” instead of the
more usual “GO” machine-code extension. An overlay routine was then written
and called “NPfh.OV”. The overlay program is loaded and executed automatically
when you type “NASPEN”.The overlay loads NASPEN at B800 and the extension file
“NASPEX” at B000. It then initialises the printer and cold-starts NASPEN.
The sequence of operations is then as follows:–
-
Call Naspen by typing ‘NASPEN’ after the “S”prompt
-
PolyDos sees that NASPEN has the extension “NP” so it loads the file
‘NPfh.OV’ into the overlay area (C800 onwards), and executes it.
-
NPfh.OV loads the NASPEN file and the extensions “NASPEX.GO” and jumps to
the start of NASPEN at B800H. If this confuses, read the Polydos manual
on overlay file handlers.