# 80-Bus News

## May-June 1983, Volume 2, Issue 3

The workings of NASCOM ROM BASIC Ver 4.7

PAGE 16

LOG

MULT FPMULT

DIV

DVBCDE

TSTSGN SGN ABS STAKFP PHLTFP FPBCDE BCDEFP LOADFP FPTHL SIGNS CMPNUM FPINT INT ASCTFP NUMASC SQR

POWER

FECT

F706 F708

F767

F768

F813 F822 F838 PO44 F851 F854 FO5F FQ62 Fa6B F879 FS8E FSBB F8E6 FOIA FOBS FAAC

FABS

LOG(X) routine. Get LOG of FPREG.

Scale the number to be between O and 1.

Divide into SQR(2).

Subtract from 1.

Compute the sum of series using LOGTAB for coefficients. Subtract 0.5 from result.

Re-scale the number and then multiply by LOG(2). Multiply FPREG by value on etack.

MULTIPLY FPREG by value in BODE.

Divide the value on stack by FPREG and leave the result in FPREG.

Divide the value in BODE by PREG and leave the result in FPREG.

Test sign of number in PPREG.

SGN(X) routine.

ABS(X) routine.

Move value in FPREG to stack.

Move value at HL to FPREG.

Move value in BCDE to FPREG.

Move FPREG to BCDE.

Move value at HL to BCDE.

Move Value in FPREG to HL.

Set sign of result depending on signs of operands. Compare numbers.

Get integer of FP value.

INT(X) routine.

Convert ASCII floating point number into binary. Convert floating point binary into ASCII.

SQR(X) routine. Uses SQR(X) = X * 0.5

Raise base BCDE to the power FPREG. Uses X*Y = EXP( Y*LoG(X) }.

The workings of NASCOM ROM BASIC Ver 4.7

PAGE 17

EXP

FAFA

SUMSER FB5B

SUMSER1 FB6A

RND cos

SIN

TAN

ATN

WIDTH LINES DEEK DOKE SCREEN SCRADR INLINE

GETXYA

SETB RESETB POINTB

XYPOS

FBSB FCOO

FCO3

PC67

F67C

FDAS FDAD FDBC FDC? FDE6 Fett FEES

FFI5

FF40 FF55 FF79 FF96

EXP(X) routine.

Seale value to be between © and 1

Compute sum of series using EXPTAB for coefficients. Re-scale number.

Sum the series using table of coefficients at HL. (C Nt * xX’2 +2) * x*2 4+ N5 ) # x2 00. 4 Nn

Sum the series using table of coefficients at HL. (CM *X+N2)*X4N5) *®X 0.04 Nn

RND(X) routine. COS(X) routine. Uses COS(X) = SIN(X+PI/2).

SIN(X) routine. Divide angle by 2*PI.

Get fraction part.

Move other quadrants around and set what result will be. Sum the series using table of coefficients at SINTAB. Adjust result.

TAN(X) routine. TAN(X) = SIN(X) / COS(X).

ATN(X) routine.

If value > 1 then get 1/value and set PI/2 – angle.

Sum the series using table of coefficients at ATNTAB. Negate result if original value was > 4.

WIDTH routine. Set terminal width but NOT commas width. LINES routine.

DEEK(X) routine.

DOKE A,V routine.

SCREEN X,Y routine.

Get screen address from row and column in DE and BC.

Get an input line from NAS-SYs,

Get (X,Y) for SET,RESET and POINT. Return address on screen and a bit mask.

SET(X,Y) routine. RESET(X,Y) routine.

POINT(X,Y) routine.

Convert (X,Y) to a row and column on screen,

35

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