Hello All from California

Introduce yourself to your fellow forum members - what was your journey into the Sinclair world?
brogine
Posts: 3
Joined: Wed Sep 23, 2020 11:02 pm

Hello All from California

Post by brogine »

I first got a TS1000 in the mid-‘80’s. Some years later I dipped a tentative toe into machine language. Browsing a few posts, it seems most of you are far more sophisticated than I, so I probably won’t have much to contribute. I’d really like to know if there’s a currently available emulator which will enable me to save programs. The one I have - for the iPad - doesn’t appear to. I’ve written mostly numerical programs, but I have a few moderately interesting moving graphics I’d like to see again and share.
For the hardware boffs - I’m curious about whether one could make a truly random random number generator, say by snagging TV or radio signals. yr pal, Stephen
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Hello All from California

Post by Paul »

Welcome to our Forums.
Emulators for which platform are searched for?
Kind regards Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Hello All from California

Post by 1024MAK »

Hello and welcome to our forum Stephen!

:D :D :D

Please don’t be put off by what you see and read in the various posts. We have a wide range of members from all round the world, some of which are only just starting out with a Sinclair/Timex machine or compatible (be it a Zeddy, Spectrum, Z88, or various compatibles or clones), learning as they go, through to a relatively small number of members who are very knowledgeable.

The vast majority of members only post occasionally. Often when they have a question or encounter a problem, or would like help with something.

Some of the knowledgeable members do post often. Although many of these posts are in reply to questions from other members.

So please do feel free to ask questions. The only dumb question, is the one holding you up because you won’t ask...

Having said that, do use the search facility, the subject may have already been discussed.

There are various emulators, most are designed to run on a PC. First off, have a look in the Emulator section ;-)

The iPad emulator can save memory snapshots, but unfortunately due to the restrictions that Apple enforce, what the author of the emulator can do is limited when it comes to saving and loading programs external to the iOS application. The author talks about this somewhere on here, it may be in his topic about his emulator.

There are a number of ways of generating ‘random’ like numbers, both in software and in hardware. A software only system is limited to pseudo random number generation.

Hardware can generate more of a random number.

In a ZX81/TS1000/TS1500 etc. if the SLOW mode is in use, a frames counter is advanced every time a new TV frame (actually a TV field, but with these machines it makes no difference) is displayed. So it advances at 50Hz (20ms) or 60Hz (16.67ms) depending on which TV system the machine is configured for. This can be used to seed a software pseudo random number generator so that you start the sequence at a random position (because the time between the machine being switched on and the user running your program will be a random time period).

Alternatively for some uses, you can use the frames counter directly. Especially if you only need random numbers occasionally and your program is not synchronised to the TV frame rate.

You can also use the user (display a prompt and time how long they take to press a key) to generate a random number.

The more expensive options that are hardware specific random number generators include unsynchronised counters and noise generators.

First, the counters. You have two completely independent oscillators (astable multivibrators). One very, very fast, one a lot, lot slower. The fast one clocks a binary counter. The slow oscillator then stops the fast oscillator every cycle and transfers the number from the fast counter into a latch. Then the fast oscillator continues. The computer can then read the number from the latch to get a random number. Because the independent oscillators are not synchronised, the numbers should be truly random. However the power supply arrangements do have to be very carefully done so that the two oscillators can’t influence one another. So very good power rail decoupling is required. It’s also a good idea to keep the two sets of circuitry apart.

Noise generators take advantage that semiconductor devices (diodes, transistors) are electrically noisy, especially when operated in certain ways. An amplifier then increases the voltage of the noise signal. Then is is processed and made available to the computer. There are various ways to process it depending on the requirements.

I’ve not heard about or seen a random number generator that uses radio signals, probably this is because that means building a radio receiver. Not easy if it’s next to a computer that generates lots of radio frequency interference... (most 8 bit home computers outside the USA are unshielded).

I hope you enjoy the forum :D

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
brogine
Posts: 3
Joined: Wed Sep 23, 2020 11:02 pm

Re: Hello All from California

Post by brogine »

Thank you! A lot to digest, and I run a little dilute on the old mental enzymes. For a long time I had a wonderful emulator on a PC, storing many programs. The ol’ Dell now functions only to tell me that it can’t find its operating system. I asked about the random number issue once on another forum, and I got no farther on the response than “connect your Geiger counter”.
This came up when, under certain conditions, a pattern would appear in a ‘randomly’ generated array of black and white squares. Must have been a kind of numerical resonance. Or something. Actually, everything is something.
Anyhoo, thanks again. You’re both very kind. What kind of programming do you do?
yr pal, Stephen
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: Hello All from California

Post by Moggy »

Hi Stephen a big hello from me too.

Don't worry about knowing things, I'm the forum dunce and I do ok! :lol:

Maths programs are an interest to me so it would seem we have common ground there so do feel free to share.

The zeddie (albeit using Forth) can work out factorials as high as 4000! And using BASIC can display PI to a similar amount of decimal places. Not bad for a little 8 bitter!!

As for the RND thing it is an interest of mine too as I need such a device,( I have an interest in cipher creation)
The nearest thing I can get to onboard randomness is to use a mersenne twister algorithm,unfortunately though it takes forever to do anything and only produces non-integer results. :(

https://en.wikipedia.org/wiki/Mersenne_Twister

PRNG's tend to be cyclical in nature and in the 8 bitters case it's 65535 iterations before rinse and repeat so the secret is to obfuscate the out put as much as possible.
I find that using XOR,random bit rotation then finally bit inversion in the same routine can also produce interesting results.

Anyway once again hello from me too.

Regards.

Moggy.
Lardo Boffin
Posts: 2169
Joined: Sat Nov 26, 2016 2:42 am

Re: Hello All from California

Post by Lardo Boffin »

Welcome on board!

You can learn a lot on this forum, I certainly have. :D Not least that I have a thriving ZX81 refurbishing business. :shock: Before joining I had never used a soldering iron.
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
brogine
Posts: 3
Joined: Wed Sep 23, 2020 11:02 pm

Re: Hello All from California

Post by brogine »

Attn:Moggy
Re math programs
If it might interest you, what I’ve done is things like programs to find solutions to simple equations like ax^2 + b = y^2 for different constants a,b, and looking for patterns. Also w(x y)z, which is my shorthand for w^3 + z^3 = x^3 +y^3, with 0<w<x<y<z. There were some interesting results. Amazing intricacies in the set of integers, ostensibly the simplest of mathematical objects. Also, a Galton board and a Tower of Hanoi, as a game or a fast demo of the optimal solution, with option of number of discs. Actually, the first things I ever did were on a programmable HP25, my premier achievement on that being finding successively longer strings of composite numbers.
Nothing super-sophisticated, but great fun.
I’ve done little in straightforward math in machine code, but managing moving graphics is also mathematical manipulation.
Stephen
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: Hello All from California

Post by Moggy »

brogine wrote: Mon Oct 05, 2020 8:47 am Attn:Moggy
Re math programs
If it might interest you, what I’ve done is things like programs to find solutions to simple equations like ax^2 + b = y^2 for different constants a,b, and looking for patterns. Also w(x y)z, which is my shorthand for w^3 + z^3 = x^3 +y^3, with 0<w<x<y<z. There were some interesting results. Amazing intricacies in the set of integers, ostensibly the simplest of mathematical objects. Also, a Galton board and a Tower of Hanoi, as a game or a fast demo of the optimal solution, with option of number of discs. Actually, the first things I ever did were on a programmable HP25, my premier achievement on that being finding successively longer strings of composite numbers.
Nothing super-sophisticated, but great fun.
I’ve done little in straightforward math in machine code, but managing moving graphics is also mathematical manipulation.
Stephen
Hi Stephen

It seems we both have similar views re maths and it's nice to know I'm not the only one any more! :lol:

The ROM's maths functions of the Zeddy are not the most accurate regardless of ROM issue and can output results that are "interesting".


The following links are to a computing magazine which started life as a useful computing resource before going the way of others and becoming a game centric tome. The articles within are by maths guru Frank O'Hara.

https://archive.org/stream/ZX-computing ... 3/mode/2up

https://archive.org/stream/ZX-computing ... 7/mode/1up

https://archive.org/stream/ZX-computing ... 8/mode/1up
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Hello All from California

Post by 1024MAK »

Quick question to Moggy, did one of the replacement BASIC ROMs for the Zeddy include more accurate/better mathematical routines?

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: Hello All from California

Post by Moggy »

If you mean the ROMS created by others apart from Sinclair then the short answer is yes and no.

The longer answer for which I apologise is that as you know the first ROM was bugged, the "improved" ROM no longer had the bugs but still suffered from a rounding inaccuracy at the 32nd bit, which may a disaster when doing box girder bridge stress calculations and give unexpected results sometimes, it is however more than OK for normal use. The calculator routines are also very slow.

The best replacement ROM I am aware of and do indeed use is the X2 BASIC ROM by Zsolt.

viewtopic.php?f=5&t=2986

Which whilst still possessing the unavoidable floating point issues all the ROM types will inherently have it does use some differently written maths routines in its execution and this coupled with better graphic handling make it surprisingly fast.

For example I have a simple chaotic number generator of my own creation based on the logistic equation for use in my cipher work.It works out the number prints it at the screen bottom then scrolls indefinitely. With the standard ROM this is painfully slow whereas with X2 ROM, with the faster maths and graphic routines, it's so fast as to be unreadable.

If you have ever played any of Andre Baunes' excellent games in BASIC you will notice he tends to use quite a few maths calculations to do certain things in the games. The X2 ROM makes some of these games play a damn sight faster and smoother than is usual for just BASIC and a lot of this down to the faster maths routines.

I also believe the "shoulders of giants" ROM had a few maths improvements and that the X2 is based on some of this work.

Sorry again for long winded reply but thought it worthy of explanation.
Post Reply