TSS/8, OS/8, BASIC8 Discord group?

142 views
Skip to first unread message

Rick Adams

unread,
Mar 9, 2024, 10:03:00 AMMar 9
to PiDP-8
After doing quite a bit with TSS/8, I've begun playing around with OS/8, and find the BASIC8 programs I developed previously with TSS/8 have some problems with this newer OS.

Is there a nice, friendly Discord for this subject where I might find some answers?

For one thing, I find that RANDOMIZE does not seem to actually randomize: RND(0) always returns the same sequence of random numbers.

Vincent Slyngstad

unread,
Mar 11, 2024, 3:45:19 PMMar 11
to PiDP-8
I can see RANDOMIZE not working correctly if there's no clock or similar variable with which to seed the generator.

I think you might see more action over at

though I can't say if anyone will be able to answer off the top of their heads.

Vince

Steve Tockey

unread,
Mar 11, 2024, 11:14:59 PMMar 11
to PiDP-8

I've seen it elsewhere, but also in one or more versions of PDP-8 BASIC that the RANDOMIZE function executes as a NOP (no operation). The instruction is only there to be recognized and thus provide compatibility (i.e., so you can run the same source code) but it doesn't actually do anything. I did look into the OS/8 Language Reference Manual and it claims to actually do randomization.


-- steve


Vincent Slyngstad

unread,
Mar 12, 2024, 1:31:56 AMMar 12
to PiDP-8
OK, I took a few minutes to look at the manual, and then at the implementation.

The manual hints that the "seed" planted by RANDOMIZE is in fact, the count of loops during TTY I/O waiting.

So, if you just RANDOMIZE and ask for a random number, you'll always get the same sequence.  However, if you interact with the terminal in some way, particularly for input, RANDOMIZE will set up a new sequence.  A look at the implementation in BRTS.PA bears this out.

Hope that helps!

Vince

Rick Adams

unread,
Mar 12, 2024, 2:06:56 PMMar 12
to Vincent Slyngstad, PiDP-8
I’ve tried RANDOMIZE, INPUT A$ and then generating RND(0), and I’ve tried RND(-1) and RND(N) where N is any number of positive integers, and it’s the same sequence of random numbers each time.

It’s curious that the earlier and more primitive BASIC8 with TSS/8 gets this right with no problem. It also has an ON GOTO and OS/8 doesn’t, even though OS/8’s BASIC obviously has a boatload of more advanced features that TSS/8 lacks.

It’d be nice to be able to access OS/8 via telnet like you can with TSS/8, but placing a ttix command in the boot script at various places doesn’t work.

Trying to port a random maze BASIC program from TSS/8 to OS/8 is giving me a FM ERROR… memory full? TSS/8 can do a 8x8 maze; even a 5x5 maze gives me this error with OS/8, which is puzzling. Is there a list of error codes for which I can look up FM ERROR?

Vincent Slyngstad

unread,
Mar 12, 2024, 4:49:33 PMMar 12
to PiDP-8
Sorry.

TTY I/O waiting affects RANDOMIZE, which then optionally affects RND.  So, you need to do the I/O before the RANDOMIZE or it has no effect.

In general you need some kind of sort-of-random counter thing for RANDOMIZE to work.  On TSS, there is a clock, so that's easy. On OS/8, they used the spin-waits for TTY input and output, since there is no clock.

Vince

Rick Adams

unread,
Mar 12, 2024, 4:58:20 PMMar 12
to Vincent Slyngstad, PiDP-8
Okay, I got that to work, thank you. Of course, what if I don’t NEED to input anything? ^_^;

Still trying to figure out my FM ERROR.

Vincent Slyngstad

unread,
Mar 12, 2024, 5:33:46 PMMar 12
to PiDP-8

Chapter 6 is all about OS/8 BASIC.  On page 6-117 it mentions that "FM" is "Attempt to fix negative number", meaning that an attempt was made to convert a negative floating point value into an index or subscript.

Hope that helps!

timr...@gmail.com

unread,
Mar 12, 2024, 7:52:25 PMMar 12
to PiDP-8
Where did you find this BASIC random maze program?  I remember having one in BASIC, but probably later than my TSS/8 days, but I don't remember for sure.  It could decent sized mazes too.  Much bigger than 8x8.  If we can see the code we might see what the issue is.

Vincent Slyngstad

unread,
Mar 12, 2024, 8:44:42 PMMar 12
to PiDP-8

Rick Adams

unread,
Mar 12, 2024, 9:45:06 PMMar 12
to pid...@googlegroups.com

No, it's one I wrote myself.  Please see:

https://github.com/yggdrasilradio/b8pp/blob/master/maze.txt

https://github.com/yggdrasilradio/b8pp/blob/master/maze.bas

Here's what I have, altered to be more compatible with OS/8 BASIC:

--
You received this message because you are subscribed to a topic in the Google Groups "PiDP-8" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pidp-8/D-HPJ1Uk3kA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pidp-8+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-8/93e35c82-89ce-468b-8540-e5a83085e763n%40googlegroups.com.

Rick Adams

unread,
Mar 12, 2024, 9:59:19 PMMar 12
to pid...@googlegroups.com

Nevermind, I seem to have fixed it!

On 3/12/2024 7:44 PM, Vincent Slyngstad wrote:
--

Rick Adams

unread,
Mar 13, 2024, 9:52:19 AMMar 13
to pid...@googlegroups.com
It’s a maze program I wrote myself. I managed to figure out what I was doing wrong, now it works fine, and I’m able to generate pretty much as large a maze as I want. Thanks for everyone’s help!

Still not sure what FM ERROR was, it was complaining about a RETURN statement of all things, but my error was unwisely reusing a variable name.

Vincent Slyngstad

unread,
Mar 13, 2024, 12:26:53 PMMar 13
to PiDP-8
You are welcome.  I got your program working here, too.  I had to go get the PiDP version of OS/8 BASIC -- the archived V3D systems seem to share a mangled version.  The copy I got of your program from github also needed to be updated. At this point I'm reading it in from PTR:.

Not sure about that FM error either.

At some point in the future I want to put together a working RK05 image which can run all the DECUS games.
Reply all
Reply to author
Forward
0 new messages