80-Bus News

  

July-October 1982, Volume 1, Issue 3











Page 9 of 51











9

The N command should now work correctly but I am afraid that it still prints that damned n! The warm start back into Naspen is still achieved by EB806.

RESET SWITCHES

I would like to thank Dusty Pulver for all his CP/M notes which are of tremendous value to a CP/M novice like me, but just in case no one else has pointed it out, his reset switch 1 (which resets Nas-Sys) will not give a CP/M warm boot because the switch is activating the NASCOM reset line and the NASCOM at that point clears all the Port set up for the disk drive controller card! He will just have to be content with EO enter from MONITOR.COM.

Robert Hill, Hemel Hempstead

RANDOMISE FOR NASCOM ROM BASIC

One of the niggling omissions from the Nascom ROM BASIC is a RANDOMISE function, to make the RND function produce unpredictable numbers. This USR callable subroutine should help a bit.

LD A,R ED 5F LD B,A 47 XOR A AF LD HL, (OOD) 2A OD EO JP (HL) EQ

This can be put anywhere in unused memory by a series of DOKEs, such as:

50 FOR I=0 TO3

60 READ A: DOKE 3360 + 2*I,A 70 NEXT I

80 DATA 24557,-20665, 3370, -5664 90 DOKE 4100, 3360

It uses the neglected Z80 instruction which reads the refresh register. If the computer has been waiting for an input from an unpredictable source such as the

user, this will provide a number in the range 0 to 127. This can be used to send the RND function as in:

100 A = RND(-USR (0))

This will start one of 127 different sequences of random numbers, which may still be too predictable for some purposes. In this case, a subroutine to step through the sequence would be better. This can be called after each INPUT line if necessary:

50000 FOR I=0 TO USR(O):A=RND(1 ): NEXT: RETURN

Peter Dishart, Wembley.

Please publish the following erratum to my article "INPUTting and READing Double Precision Constants" in 80-BUS News Vol. 1, Issue 2:

Line 2230 of the routine published should read: LH = VAL(RIGHTS(A$,K-7))/10*(K-7)

My thanks to Adrian Sauter for pointing this out to me. Mike York.


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











Page 9 of 51