Why is the ZX81 so slow?

Y'know, other stuff, Sinclair related.
Post Reply
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Why is the ZX81 so slow?

Post by MrPixel »

i'm curious. the zx81 is a good little computer, why is it that it is so slow in emulation. was it like that during release :?:
User avatar
PeterJ
Site Admin
Posts: 6859
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Why is the ZX81 so slow?

Post by PeterJ »

Yes. It was fantastic in 1981, and very affordable for it's time. There were plenty of great games like 3D Monster Maze, and later in it's life even High Resolution titles.

https://spectrumcomputing.co.uk/index.p ... up_id=1027
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Why is the ZX81 so slow?

Post by Nomad »

No Screen bounce, highly extendable (with blutack), good price point that blew open a otherwise untapped sector. Wide user-base. Plus you had a guy and a development team that had a lot of experience of commercial failure. Sinclair were very well positioned to come to market with something like the zx81, why I mention the failures because they went about development of the widgets in a totally different way to say Dragon who were another company that brought an interesting yet nearly irrelevant product to market. Plus they knew the demand was present because of the zx80.

Indirectly it also crippled S-100 Bus getting a foothold in the country.

You can check the magazines from the period but you were still getting articles well into the mid-80s that shows a pretty strong user base well past the predicted product lifespan of the widget. Games are ok compaired to others of similar price point/era.

I think where the zx81 gets a harsh rap is its compared to systems that would have cost thousands of dollars of course its going to suck :lol: I would have killed for a fully featured s-100 bus machine with a bunch of fancy cards but hardly anyone had that kind of ability to source that stuff in the UK. :lol:
AndyC
Dynamite Dan
Posts: 1388
Joined: Mon Nov 13, 2017 5:12 am

Re: Why is the ZX81 so slow?

Post by AndyC »

Mostly because the Z80 has to spend a fair amount of it's time assisting in producing the video display. That's why programs run faster in FAST mode, because the screen is simply disabled while programs run to let the Z80 focus on productive work rather than generating display info.
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Why is the ZX81 so slow?

Post by Ralf »

Yes, I recall too that it uses CPU to generate video display. If I remember correctly it uses about 80% of CPU power for that.
Spectrum is more advanced construction. It has specialised chip called ULA which deals with display and leaves CPU free.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Why is the ZX81 so slow?

Post by Ast A. Moore »

Ralf wrote: Tue Mar 27, 2018 11:54 am Spectrum is more advanced construction. It has specialised chip called ULA which deals with display and leaves CPU free.
The ZX81 also had a ULA.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Why is the ZX81 so slow?

Post by Joefish »

Yes, it's around 62% of the time out of each frame of the TV image, the CPU is actually converting the screen (character) memory into bitmaps (by looking up the font grahics in ROM) and feeding that out in the TV signal, because it doesn't have a dedicated chip like the Speccy's ULA.

If you use the BASIC keyword FAST, or when loading from tape, the screen display is turned off to dedicate the CPU to the job in hand, in which case its performance is close to that of the Speccy.

It's like when the Speccy is running a full-screen multi-colour effect, by re-writing the attributes every scanline. That has to shift as much data as possible every scanline, so is busy for 192 out of 312.5 scanlines => 61.44%.
spectron
Drutt
Posts: 25
Joined: Thu Mar 29, 2018 3:27 pm

Re: Why is the ZX81 so slow?

Post by spectron »

Ast A. Moore wrote: Tue Mar 27, 2018 12:01 pm
Ralf wrote: Tue Mar 27, 2018 11:54 am Spectrum is more advanced construction. It has specialised chip called ULA which deals with display and leaves CPU free.
The ZX81 also had a ULA.
Yes but it had nothing to do with the display
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Why is the ZX81 so slow?

Post by 1024MAK »

MrPixel wrote: Tue Mar 27, 2018 6:37 am i'm curious. the zx81 is a good little computer, why is it that it is so slow in emulation. was it like that during release :?:
The ZX81 is actually faster than a ZX Spectrum for some operations.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Why is the ZX81 so slow?

Post by 1024MAK »

spectron wrote: Thu Apr 12, 2018 4:16 pm
Ast A. Moore wrote: Tue Mar 27, 2018 12:01 pm The ZX81 also had a ULA.
Yes but it had nothing to do with the display
No, that's incorrect. The Z80 and the ULA work together in a ZX81 to generate the display. For example, the pixel shift register is in the ULA. And it is the ULA that controls the Z80 during the video generation sequence.

However, the ZX81 ULA is smaller (the chip inside the package) and less complex compared to the ULA in the ZX Spectrum.
The ULA in the ZX Spectrum can generate a display with no CPU help whatsoever.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: Why is the ZX81 so slow?

Post by MrPixel »

1024MAK wrote: Fri Apr 13, 2018 4:29 am
MrPixel wrote: Tue Mar 27, 2018 6:37 am i'm curious. the zx81 is a good little computer, why is it that it is so slow in emulation. was it like that during release :?:
The ZX81 is actually faster than a ZX Spectrum for some operations.

Mark
how so?
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Why is the ZX81 so slow?

Post by 1024MAK »

MrPixel wrote: Fri Apr 13, 2018 6:13 pm
1024MAK wrote: Fri Apr 13, 2018 4:29 am The ZX81 is actually faster than a ZX Spectrum for some operations.

Mark
how so?
The CPU in a ZX Spectrum runs at a slightly faster clock rate than the CPU in a ZX81, but when the ZX81 is in FAST mode, the differences in the code for the BASIC interpreter mean that for some operations, it is slightly quicker. Also on the ZX Spectrum, the BASIC program runs in RAM that suffers from contention (the ULA chip pauses the Z80 CPU during memory reads when the ULA is generating the video picture). Have a look at this article on BASIC program benchmarks here.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
AndyC
Dynamite Dan
Posts: 1388
Joined: Mon Nov 13, 2017 5:12 am

Re: Why is the ZX81 so slow?

Post by AndyC »

1024MAK wrote: Sat Apr 14, 2018 2:01 am The CPU in a ZX Spectrum runs at a slightly faster clock rate than the CPU in a ZX81, but when the ZX81 is in FAST mode, the differences in the code for the BASIC interpreter mean that for some operations, it is slightly quicker. Also on the ZX Spectrum, the BASIC program runs in RAM that suffers from contention (the ULA chip pauses the Z80 CPU during memory reads when the ULA is generating the video picture). Have a look at this article on BASIC program benchmarks here.
From which you could say that BASIC on the ZX81 is faster than on the Spectrum, but not generically that the ZX81 is faster. Even in FAST mode, assembly language running from uncontended ram on the Spectrum will out perform the same Z80 code running on the ZX81.
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Why is the ZX81 so slow?

Post by 1024MAK »

Yes, machine code in non-contended RAM will always be faster on a ZX Spectrum than a ZX81 running in FAST mode. Hence why in my original post I worded it very carefully.

With machine code in, or using contended RAM, it very much depends on what it is doing and when it it doing it (compared to where the ULA is with respect to drawing the video image).

The reason that the ZX Spectrum BASIC is rather slow is simple. Sinclair wanted to pack as many features as possible into the 16k byte ROM. So the code was written to be as compact as the software writers could manage. As the code was optimised for a small code size, it's not possible to also code for a fast speed at the same time. Compare this to the Acorn BBC Micro, where it has 16k bytes of ROM dedicated to BASIC alone and nearly another 16k bytes of ROM for all the system routines (the MOS or OS).

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
Post Reply