The ZX81 was my first computer in 1985 (not counting scienticic calculators but the weren't fun hacking with). As the BASIC is slow I soon got into "machine language" which meant a series of poke statements and a print usr ... somewhere. The slightest error caused the screen to flicker and the data was lost - so save it to Compact Cassette first :-) The main advantage of the ZX81 back then was its Z80 CPU which was made as U880 in East Germany (of which I was an "inmate"). Almost all computers within my reach at the university run on that chip - so learning how to program it was considered "valuable skills for the future" - impressive how fast it got obsolete. But a nice chance to learn how computers work under the hood. I wrote a calculator for integers - multiplication and division which the Z80 cannot perform by itself, number conversion etc. As we did not have much access to books - the ROM was always a black box I tried to reverse engineer... Nice memories. I still have my ZX81 and some cassettes with my stuff. I'll have to power it on somedays and look what I programmed back then... I'
Just add a couple of lines to your BASIC, to make it 4x as fast. 5 FAST 10 LET A=3 20 FOR B=1 TO 18 30 PRINT A*B 40 NEXT B 50 SLOW In SLOW mode the Z80 has the job of updating the screen. You effectively have a 0.8MHz rather than a 3.25MHz Z80. When you issue a FAST, the display is no longer updated whilst the Z80 is busy. When SLOW executes, the updated screen with all the PRINTed numbers will be shown.
The Sinclair ZX81 was my First Computer. I loved it. Programming an playing very Basic games like 'Pong'. I got a book called 'What can you do with a 1K ZX81'?... I soon found out 'Not a lot.'.. I got frustrated and purchased a 16K Ram pack. Reading from magazines i programmed all sorts of things like adventure games and racing games. The keyboard was horrible to use and ONE touch near the ram pack and the whole set up would crash.! Then came the Spectrum with a whopping 16/48K of ram...WOW my whole world had opened up...I bought My first Spectrum 48K in 1983 and it was second hand but still cost me £75.00. About £400 in todays money.! I'll never forget playing Manic Miner.. Awesome game and kept me entertained for hours at a time. Move on to 1987 (ish).. Came the Commodore Amiga..! 512K of pure power...AND a fricking keyboard and a disk drive !! I bought one brand new and it was £499.00 ( About £1500 in todays money.) It was absolutely amazing.. 512K memory !.. The games were great and in full colour. Every week i would buy magazines all about it. The Demos you could get were amazing..( Doc Demo etc.) A vintage time in computing from one fellow computer to another. Great times.
Late reply, but it's RU-vid and their stupid policy. They monetize off your videos until you meet the requirements for ad revenue, and to become part of their Partner Program. You pretty much get ads running on your videos, even if you have less than 1,000 subscribers will they still run ads.
That whole thing (BASIC INT and the m/c language version, ARE SLOWED DOWN MASSIVELY INDEED by the PRINT routine. Machine language is about 100 times as fast as BASIC INTERPRETER code running the BASIC program.
Nice premise. I like your presentation. I used to code in Z-80 and 8080 Assembly back in 1980-ish. I think if you want to be absolutely fair, you'll display your results in decimal on the assembly version. It may be that there is a ROM routine on the ZX81 which contains a Hex-Dec converter. It might be interesting to add a call to that and then compare speeds. I think Assembly will still win, but it will be closer.
Yes I agree, will try to change the assembly version to output as decimal. The daa instruction would be a quick win to use binary coded decimal and world be interesting to see the difference. I'll have a look for some other ways like you suggested. Thanks for your comment
The Z80 @ 3.25MHz may be quicker than the 6510@1MHz, but that BASIC program still runs in under a second on the C64. I think it looks faster than your m/c! Try this in VICE... N.B. There was no CLS command in C64 BASIC, but line 10 does the same. ? is shorthand for PRINT on the Commodore. A peculiarity of Sinclair BASIC was it did an implicit CLS when you entered RUN. 10 ? CHR$(147) 20 A=3 30 FOR B=1 TO 18 40 ? A*B 50 NEXT
The 81 had the processor do the graphics. It looked up the character from the ROM in real time per scan line. It had little power left over. Its "FAST MODE" turned the screen off and it processed fast then! Some chess games gave that as an option. Some people also found a loophole to hack into the display code and run their own for pseudo high res graphics from the ROM. And from the RAM on the 1K version and special 16K ram packs.
It's funny how computers then booted up instantly. Today even fairly recent phones and Desktops lag when click on something and make people feel they need a faster PC!
@@andrewnorris5415 the difference is an operating system versus direct execution of smaller program in ROM. 16 kB program versus a one GB program set....
It spends most of its CPU time generating the TV picture itself... That said it can still be very very fast indeed with the proper programming...way faster than is shown here . The BASCI is very slow due to s supporting a collapsed display file and other reasons, doesn't mean the machine itself is that slow it just appears to be the case...