80-Bus News

  

May-June 1983, Volume 2, Issue 3











Page 33 of 59











The workings of NASCOM ROM BASIC Ver 4.7

PAGE 12

END

coNnT

NULL

CHKLTR

FPSINT

POSINT

DEPINT

DEINT

ATOH

CLEAR

RUN

GOSUB

GoTo

RETURN

DATA

REM

LET

ON

E872

ES9E

ESBI

HOTT

EQ7F E982 £985 E98B E9A5

EQCA

BAIO

BAIC

EA2D

EA4B

EATO

EAT2

EAST

EBAR(

END routine. Flag "END".

Save address of break and set continue address and line. If from STOP or break then output "Break" message and if not a direct statement then output line number also.

CONT routine. Get continue address, if it ia zero then output "9ON Error” else set address and line as current and continue.

NULL routine. Set number of nulls to be output after CRLF.

Test next character in code string and return flags:– Nc – Letter, C – Not a letter.

Get an integer 0 to 42767 from next character.

Get an integer 0 to 32767 to DE.

fest for integer 0 to 32767 and leave it in DE.

fest for integer -32768 to 32767 and leave it in DE.

Read an ASCII integer 0 to 65529 into DE from code string. CLEAR routine. "CLEAR" Clear variables,

“CLEAR s" alao reserves string space (where t is O to 32767), "CLEAR,t" sets top of memory (where t is 0 to 32767),

"CLEAR s,t" reserves string space and sets RAM top.

RUN routine. "RUN" run from start of program, "RUN n" run from specified line.

GOSUB routine. Create a GOSUB block on the stack and GOTO specified line.

GOTO routine. Get ASCII line number and continue execution from that line.

RETURN routine. Look back through stack for a GOSUB block and if one is found POP line number and address in line and continue execution from there. Otherwise "?RG Error” occurs.

DATA routine. Plag DATA and drop through to common code.

REM routine. Flag REM and look for end of statement, DATA

statement ende with ":" or null, REM statement ends only with null (End of line).

LET routine. Get variable name, make sure “=" follows, evaluate expression and assign it to the variable.

ON GOTO / ON GOSUB routine. Get integer expression (0 to 255). Look through list of ASCII line numbers until the Nth value is found. If value N exists GOTO or GOSUB that line. Otherwise drop through to next statement.

The workings of NASCOM ROM BASIC Ver 4.7

PAGE 13

IF

PRINT

INPUT

READ

FDTLP

NEXT

GETNUM TSTNUM TSTSTR CHKTYP

EVAL

FNOFST

SGNEXP

BAFP

EB23

EBFD

EC2c

ECD2

ECF6

ED41 ED44 ED45 BD46

EDSA

EE33

EE7O

IF routine. Evaluate expression. If it is sero then dop through to the next line. Otherwise GOTO line number if specified else go to execute the statement.

PRINT routine.

INPUT routine. Test for direct mode, if in direct mode then no INPUT allowed ("ID Error"). Otherwise output prompt string if one is given, Get an input line and join READ routine to assign values to variables.

READ routine. Get address of next DATA item and flag READ. Read in items an assign to variables (used for INPUT and READ). If any errors occur use READFG to see if:–

“OSN Error” or “?0D Error” are needed for READ or

"Redo" or “Extra ignored" are needed for INPUT.

Find next DATA statement.

NEXT routine. Look back through stack for a matching FOR block. If one is found then add STEP to index variable and compare it with the TO value. If the loop has not been completed then continue execution from the first statement in that loop. Otherwise remove the FOR block from the stack. Then look for another variable (Bg “NEXT B,A"). If found then re-enter NEXT routine to process this loop. Otherwise continue execution from the statement after the NEXT.

Get a numeric expression.

Make sure current value is numeric ("?TM Error” if not).

Make sure current value is a string ("?TM Error” if not). Make sure current value is of the type selected by TYPE.

Evaluate an expression using algebraic logic (Do multiplication and division before addition and subtraction. Ete.). Leave the result in FPREG and set TYPE to string or numeric.

Enter with offset into FNCTAB. If it is “POINT (X,Y)" then jump directly to “POINT (X,Y)" routine (This SHOULD have been a jump via the POINT reflection). If it is LEFT$, RIGHTS or MID$ then evaluate the string expression and get the "," after it then go to the string function. If it is any other function then get ita address from FNCTAB and call it.

Get gign of number and return in the D register:– FP – Negative, 00 Positive.

33


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











Page 33 of 59