NAS-SYS 3 was a follow-up to NAS-SYS 1 of course. I still don’t know what happened to NAS-SYS-2. I don’t remember seeing it. This time the monitor was released under the company name of Interface Components. It was still written by the same person though!

At last we had a repeating keyboard! This was something often seen on professional equipment but not available on the NASCOM range until now. Also, the old paper tape handling routines, L and D, which had been in every monitor up until now, were finally removed. They were rarely used since the much faster R and W tape routines appeared.

Commands


A – hexadecimal arithmetic

   A xxxx yyyy responds with:   SSSS DDDD JJ

SSSS is sum of xxxx and yyyy

DDDD is difference of xxxx and yyyy

JJ is displacement required in a Jump Relative instruction which starts at xxxx, to cause a jump to yyyy. If such a jump is not possible ?? is displayed instead.

B – set breakpoint

   B xxxx

Set a breakpoint at xxxx. B 0 de-activates the breakpoint. This must only be set as the first byte of an instruction, as it temporarily replaces the instruction with E7H. Now B 0 completely de-activates the breakpoint system so that NAS-SYS can be run from RAM rather than EPROM. This was important as there was an intention to add disk facilities to the NASCOM using CP/M. This required RAM from address 0000 so there was no room for a monitor.

C – copy

   C xxxx yyyy zzzz

Copy a block of length zzzz from xxxx to yyyy. One byte is copied at a time, starting with the first byte, so if there is an overlap in the two areas data may be destroyed. This command is useful for filling a block with a single value. Make yyyy one greater than xxxx and put the required value into address xxxx. Set zzzz to the number of bytes required.

D – D000

  D
New command intended for developers – just a jump to address D000 to start the ZEAP assembler EPROM if installed.

E – execute

   E xxxx

Execute program at xxxx. If xxxx is omitted then the stored program counter is used. This means that to continue execution after a breakpoint, just enter E.

G – generate

   G xxxx yyyy zzzz

Generate auto-start tape. Data from xxxx up to yyyy-1 is written to tape and the auto-start address is set to zzzz.

H – operate as half-duplex ASCII terminal

   H

Just waits for input characters and outputs them. Can only be ended by pressing reset. To make the nascom act as a terminal enter X 30 then enter the H command.

I – intelligent copy

   I xxxx yyyy zzzz

Like the Copy command but starts copying at the end of the block which will not cause data corruption in an overlapping section.

J – execute at FFFA (to start BASIC etc)

   J

Just a jump. Normally 8k BASIC cold start address.

K – set keyboard options

   K xx

K 0 is the normal mode following a reset.

K 1 reverses the shift key on the letters

K 4 reverses the effect of the GRAPHICS key (nascom 2 only!)

K 5 has the effect of both K1 and K4

M – modify store

   M xxxx

Modify memory starting at address xxxx. The address is displayed followed by the current data. This value may be changed. Enter a "." at the end of the line to end the command. Enter ":" to go back to the previous address. Enter "/yyyy" to change to address yyyy. If you enter several values then the successive address values are changed. This allows several values to be entered at once.

N – return to normal mode

   N

Resets the input and output table pointers to their normal values. This turns off an X or U command. All input will then be via the keyboard or the serial input and all output will be to the screen.

O – output to PIO port

   O xx yy

Sends value yy to I/O port xx. e.g "O 7 F" would send 0FH to port number 07H. This requres knowlege of the PIO registers.

P – display stored program registers

  P

Another new command. Displays the program registers in the same format as the breakpoint.

Q – query input from port

   Q xx

Reads value from port xx and displays it in hexadecimal.

R – read tape

   R xxxx

Reads a tape which has been written using the Write command. As each block is read the header information is displayed: SSSS BBLL. SSSS is the start address of the block, BB is the block number and LL is the length (0=256 bytes). The command ends automatically when the last block has been read. If the new, optional, xxxx value is given then the data is stored in RAM starting at that offset from the recorded address. i.e if the data was written from address 0800 and xxxx was given as 1000 then the data would be stored into RAM starting at address 1800.

S – single step

   S xxxx

Executes the single instruction at address xxxx. If xxxx is not specified then the stored program counter is used. This means that to continue single stepping after a breakpoint, just enter S. If the previous command was S then even this need not be re-typed for successive steps – just the enter key. Program registers are stored and displayed after each step. From this version of NAS-SYS it is possible, though inefficient, to single step through NAS-SYS routines. It is best to enter a breakpoint immediately after the call to NAS-SYS and enter E to call the routine. Single stepping through the user program can then continue. It is now possible to high speed single step by just holding down the ENTER key. The repeat speed can be changed by changing the value at KSHORT (0C30-0C31).

T – tabulate

   T xxxx yyyy zzzz vv hhaa

Tabulate (display) a block of memory starting at xxxx and continuing to yyyy-1 displaying zzzz lines at a time. Press any key to display the next block or ESC or Shift/ENTER to end the command. Set zzzz to 0 to output all the data without a pause. By entering the command X 0 then entering the tabulate command with zzzz set to 0 the data is sent to the serial port, where it can be punched onto paper tape (sic). A checksum is output at the end of each line. The data can be read back using the Load command. The new arguments vv and hhaa work as follows: If vv is 0 then 8 bytes are output on each line. Otherwise 8+vv bytes are output. If aa is not 0 then the ASCII part of the display is supressed. Likewise, if hh is not 0 then the hex part of the display is supressed.

U – activate user I/O routines

   U

The user output routine must be pointed to by an address at 0C78H and the user input routine must be pointed to by an address at 0C72H. On reset these point to a return instruction within NAS-SYS so if these addresses have not been changed entering a U instruction will have no effect.

V – verify tape

   V

Identical to the Read command but the data is not stored in memory. Used to checking tape data. Note that this does not compare memory contents with the tape.

W – write tape

   W xxxx yyyy

Write data to cassette tape. Data from xxxx to yyyy-1 is written to tape. Data is in blocks of 256 bytes (but the last block may have less). 256 nulls are written when the command starts followed by the data. Each block starts with one null and ends with 10 nulls.

X – set eXternal device options

   X xx

Activate input and output routines contained within NAS-SYS.

X 0 support a terminal in full duplex mode.
every character typed is echoed to the terminal
line feed is automatically sent after every CR
all output is even parity
X 10 same as X 0 but LF is not sent after CR
X 20 same as X 0 but half-duplex.
characters are not echoed to the terminal
X 30 same as X 20 but LF is not sent afer CR
this option makes the Nascom into a half-duplex termina
1, 11, 21, 31 same as 0, 10, 20, 30 but output parity is always odd instead
of even. (Input parity is always ignored).

X Option bits

0  Parity of output characters. 0=even 1-odd


1  Suppress echo of input chars by user program 0=suppress 1=do not suppress


4  0=output CR after LF 1=do not output CR after LF


5  Make input routine echo all chars. 0=echo 1=do not echo


7  Set to 0 by output routine. 0=do not suppress next char 1=suppress next char

To input a Backspace on a terminal which does not have this key use Ctrl/H.

The X command is automatically suspended during L, R, W and G commands and re-activated afterwards.

The X command also automatically activates the U command output routine if one has been supplied. This makes it easy to support the Nascom keyboard and display, a teletype keyboard and printer and a parallel printer, all working at the same time.

Y – execute at B000
  Y

Just a jump command.

Z – execute at FFFD (warm start for BASIC)

   Z

Just a Jump command. Normally 8k BASIC warm-start address.

Program register display:


The registers are displayed in the following format during the S command or when an E7H (breakpoint) is encountered
-SP-   -PC-   -AF-   -HL-   -DE-   -BC-   -I-   -IX-   -IY-   Flags

The flags are a decoded representation of the F register, showing the following characters as each flag is set:  S  Z  H  P  N  C

ROM calls

Restart instructions:

C7 RST 0 START Reset the computer. Initialise NAS-SYS
CF RST 8h RIN Obtain an input character in the A register
D7 RST 10h RCAL Relative call. Follow by the displacement to the routine to be called. This works in a similar way to the Z80 Jump Relative instruction and allows relocatable code to be written.
DF RST 18h SCAL User subroutine call.The code DF is followed by a one byte value or the ASCII code which specifies the routine to be called.
E7 RST 20h BRKPT Breakpoint – stop & display registers
EF RST 28h PRS Output following string until 0H found
F7 RST 30h ROUT Call the routine pointed to by the address at $CRT. This is normally the CRT routine. Outputs the character in the A register
FF RST 38h Provide a delay proportional to the value in A. 00 gives maximum delay of about 7.5mS.

NAS-SYS routines can be called using SCAL instruction followed by the ASCII letter of the command. Registers HL, DE and BC should be set to the xxxx, yyyy and zzzz values as required.. e.g. DF 57 would call the NAS-SYS Write command.
Data would be written from (HL) to (DE)-1.

You can also call some routines as follows:

DF 5B MRET Controlled return to NAS-SYS
(best way to end program)
DF 5C SCALJ Calls the routine whose number is
stored at 0C0A
DF 5D TDEL Wait for about 1 sec (at 4MHz)
DF 5E FFLP Flip 1 or more bits of output port 0
then flip them back again. Register A
to hold a 1 for each bit to flip.
DF 5F MFLP Invert the state of the tape LED
DF 60 ARGS Load the contents of the ARG addresses
into registers
ARG1 -> HL
ARG2 -> DE
ARG3 – > BC
These are the three arguments entered
after a command.
DF 62 IN Scan for an input. Don’t wait.C set and
value in A if scan successful.
DF 63 INLIN Obtain input line. DE set to start of
recieved line.
DF 64 NUM Examine input line & convert a hex
value from ASCII to binary. DE set to
start of line.
DF 66 TBCD3 Output data in HL as ASCII followed by
a space. Also add H and L into C.
DF 67 TBCD2 Output value in A register as ASCII.
Also add A into C.
DF 68 B2HEX Output value in A as ASCII.
DF 69 SPACE Output a space
DF 6A CRLF Output a CR/LF sequence.
DF 6B ERRM Output the "Error" message and CR
DF 6C TX1 Output HL in ASCII, space DE in ASCII,
space. H,L,D,E are added into C.
DF 6D SOUT Send string direct to serial port. HL
points to start, B to length. C is set
to 0 and all chars added to it.
DF 6F SRLX Send the character in the A register directly to the serial output port
DF 79 RLIN Examine input line & convert up to 10
decimal values separated by spaces
from ASCII to binary. Set DE to point to
start of line, which must end with 0H.
DF 7A B1HEX Output low order (rh) half of A in ASCII
DF 7B BLINK Obtain an input character in A. Blink
cursor while waiting.
DF 7C CPOS Set cursor position to screen address
pointed to by HL. Returns with HL set
to position of first character on that
screen line.
DF 7E SP2 Output two spaces. A is set to a space character
DF 7F SCALI Not a normal routine, but is used to call any other routine when the number is not known at the time the program is written. Put routine number in register E then execute DF 7F. The routine will be called for you.

Simple I/O


To simply display the contents of A to the screen just enter the code F7H (RST 30H) into your program. You simply type in F7 as part of your program.
To read a character from the keyboard or from the serial input enter the code CFH (RST 8 ) as part of your program. The value will be returned in the A register.
In both cases no other registers will be affected.

1 Response to “Nas-Sys 3”


  1. 1 Tim Ring 16/04/2013 at 12:59 pm

    Very handy thanks, easier to read than the scanned PDFs.


Comments are currently closed.