80-Bus News

  

May–June 1983, Volume 2, Issue 3

Page 34 of 59

The workings of NAS­COM ROM BASIC Ver 4.7

PAGE 14

DIM

EF28

DIM routine. Flag “create” variable and join common.

GETVAR

EF2D

Look for specified variable. Use FORFLG to:–
1. Not allow subscripted FOR loops.
2. Look for an FN function definition.
3. Look for an array name for CLOAD* and CSAVE*.
4. Or just look for the variable as supplied.

FRE

F0D0

FRE(X) routine. If X is a numeric expression then return the amount of memory between ARREND and the stack. If X is a string expression then do a “Garbage collection” and return the number of unused bytes in the string area.

POS

F0FE

POS(X) routine. Return the current cursor position (CURPOS).

DEF

F106

DEF FN routine. Define a user defined function.
This is not legal in direct mode.

DQFN

F133

Call an FN function. Save any previous argument name and value on the stack, Evaluate the function an then restore the previous argument name and value.

TDTEST

F17B

If in direct mode then output “?ID Error” else return.

CHEKFN

F189

Make sure “FN” follows and flag find FN function definition.

STR

F19A

STR$ routine. Convert current numeric value to ASCII and create a temporary string for it.

SAVSTR

F1AA

Save current string in string area.

MKTMST

F1BF

Make a temporary string.

PRNUMS

F20F

Print number string at HL.

PRS

F210

Print string at HL.

TESTR

F229

Test if enough string space. If insufficient then GRBAGE collect and test again. If still insufficient space then output “?0S Error”.

GRBAGE

F253

Do a “Garbage collection” on string area.
Scan through all string variables and shift all active strings to the top of the string area thus leaving the free space in one block.

CONCAT

F306

Concatenate two strings (Eg A$+B$).

GETSTR

F350

Get a string routine.

LEN

F382

LEN(X$) routine.

ASC

F391

ASC(X$) routine.

CHR

F3A2

CHR$(X) routine.

The workings of NAS­COM ROM BASIC Ver 4.7

PAGE 15

LEFT

F3B2

LEFT$(X$,X) routine.

RIGHT

F3E2

RIGHT$ (X$,X) routine.

MID

F3EC

MID$(X$,P[,L]) routine.
MID$(X$,P) returns string from character P to the end.
MIDS(X$,P,L) returns string from position P for L characters.

VAL

F41C

VAL(X$) routine.

INP

F441

INP(X) routine. Set up port number in work space and call INPSUB skeleton. Return value from port.

POUT

F44D

OUT P,N routine. Set up port number in work space and call OUTSUB skeleton to output value to the port.

WAIT

F453

WAIT P,A,X routine. Set up port number in work space. Call INPSUB to get byte, XOR value with X if X is supplied and then AND the value with A. If this value is zero then go back to WAITLP until value is non-zero.

FNDNUM

F481

Get next number from code string.

CSAVE

F4C3

CSAVE routine. If CSAVE* jump to array save routine ARRSV1. Evaluate string expression for name and save program.

CLOAD

F4F9

CLOAD routine. If CLOAD* jump to array load routine ARRLD1. See if CLOAD? and save status. Evaluate string expression for file name (None given – any file will do) and search for that file. When found load it into memory.

PEEK

F5A3

PEEK(X) routine.

POKE

F5AA

POKE A,V routine.

ROUND

F5BB

Round number up by adding 0.5 to it.

ADDPHL

F5BE

Add floating point number at HL to the current value in FPREG.

SUBPHL

F5C4

Subtract the current value from the value at HL and leave the result in FPREG.

PSUB

F5C8

Subtract FPREG from the value on the stack and leave the result in PPREG.

SUBCDE

F5CA

Subtract FPREG from the value in BCDE and leave the result in FPREG.

FPADD

F5CD

Add the value in BCDE to the value in FPREG.

MINCDE

F60D

Subtract value in FPREG from value in BCDE.

NORMAL

F638

Normalise value in BCDE.

PLUCDE

F672

Add value in FPREG to value in BCDE.

COMPL

F67E

Complement value in BCDE.


NASCOM ROM BASIC source code is available in ASM and LST file format.

Page 34 of 59