NASCOM PIO DECK
EOT line} 12V
NASCOM UART =
How to save strings or string arrays on tape in BASIC.
by David Reddington
One of the shortcomings of Microsoft’s 8k BASIC as implemented on a Nascom is
its inability to CSAVE string arrays. Even to save numeric data requires the whole
numeric array to be saved when perhaps only a few elements contain valid data-
The way round this problem is to utilise the ability of NAS-SYS to change the
destination of the output. Change the reflection at SOUT (0C73 or 3187 Decimal) from
077F (CRT) to 077B (SRLX) thus:
10 DOKE 3187,1915
All subsequent PRINT statements will print to tape until output is switched
back by a DOKE 3187,1919.
NOTE: a DOKE 3187,1914 will cause all output to go to both the CRT and the CASSETTE.
A typical program might be:–
10 REM A PROGRAM TO SAVE X,Y,Z,T$, AND A$(100) FOR NAS-SYS 1
30 PRINT "Start recorder in RECORD mode – then press RETURN"
40 INPUT AS:PRINT "PLEASE WAIT"
50 DOKE DEVICE,ZSRLX Useful Subroutines in BASIC
60 PRINT XsYsZg 90 nee pence an a mem a ot
70 PRINT T$;
80 FOR N = 1 TO 100 FOAD Prints HL in decimal on the screen
90 : PRINT AS(N); F210 Prints the text pointed to by HL
100 NEXT (Until it hits a 0).
110 DOKE DEVICE,ZCRT
120 PRINT "DATA SAVED – SWITCH OFF RECORDER"
To Load the data you merely:–
200 INPUT X,Y,z 220 FOR A = 1 70 100
210 INPUT TS 230 : INPUT A$(A)