INMC 80 News

  

February-April 1981, Issue 3











Page 51 of 55











-51-

NASCOM PIO DECK

83

B2 81

80

FAST.

SELECT. MOTOR ON.

WRITE ENABLE,

B? 86

EOT. WRITE PROTECT.

see note below

READ. WRITE,

DATA OUT. DATA IN.

3320R

_{repeated for

EOT line} 12V _ +

NASCOM UART = STRINGS

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

20 DEVICE=3187:ZCRT=1919:ZSRLX=1915

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) 240 NEXT


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 51 of 55