80-Bus News

  

May–June 1983 · Volume 2 · Issue 3

Page 27 of 59

Nascom
ROM
BASIC
Dis–Assembled

PART 1

By Carl Lloyd–Parker

The workings of Nascom ROM BASIC Ver 4.7

PAGE 1

A description of BASIC’s usage of the memory


*** The work space RAM from 1000 to 10F8 ***

Name

Addr

What is it used for

WRKSPC

1000

Jump to warm start BASIC

USR

1003

Jump for user defined function “USR(X)”.
This is initialised to give “?FC Error”.

OUTSUB

1006

Skeleton for output to port “n” as the 8080 does not have the “OUT (C),r” instruction. The port “n” is loaded into 1007.

DIVSUP

1009

Skeleton subtraction routine for division. The dividend, divisor and quotient cannot all be held in the registers therefore the divisor is loaded into this routine so that there are sufficient registers for the dividend and quotient.

SEED

1017

3 byte seed for random number generator.

101A

Table of floating point values used by RND.
The seed is used to find which value of the eight to multiply the last random number by.

LSTRND

103A

Where the last random number “RND(0)” is kept.

INPSUB

103E

Skeleton for input from port “n” as the 8080 does not have the “IN r,(C)” instruction. The port “n” is loaded into 103F.

NULLS

1041

Number of nulls to output after carriage return. This value is set by the “NULLS n” command.

LWIDTH

1042

Width of terminal. This is set by “WIDTH n” command.

COMMAN

1043

Width of terminal for printing with commas.
Why this has to be a seperate byte I don’t know, however, the “WIDTH n” command sets LWIDTH but does NOT set this value, this has an irritating result when using BASIC with a printer and trying to have more than three columns using commas in “PRINT” statements, what ever you set “WIDTH” to you don’t get more than three columns! This can be overcome in a simple way: “POKE 4163,252” – This makes “WIDTH” work correctly.

NULFLG

1044

Nulls after input byte flag.
This is a flag that is examined and then zeroed by the teletype line input routine (TTYLIN). If the character input routine sets this flag before returning the input character then a null is output before the character. The only use I can think of for this is for VERY slow terminals which need to be “woken up” before a character is sent to them!

NASCOM ROM BASIC dis-assembled is available in ASM and LST file format.

Page 27 of 59