how so?
Why is the ZX81 so slow?
- 1024MAK
- Bugaboo
- Posts: 3118
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Why is the ZX81 so slow?
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
Looking forward to summer later in the year.
“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.
Re: Why is the ZX81 so slow?
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.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.
- 1024MAK
- Bugaboo
- Posts: 3118
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Why is the ZX81 so slow?
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
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
Looking forward to summer later in the year.
“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.