7 ms·
This is awesome. I still have a copy of the original book from 1983 on my bookshelf! This looks like a faithful reproduction with some added features to make ea
by klelatti 6y ago
This is awesome. I still have a copy of the original book from 1983 on my bookshelf! This looks like a faithful reproduction with some added features to make easier to use.
Looking forward to browsing some of the other code linked to from the site - e.g. Manic Miner which was a particular favourite.
A couple of points about the Spectrum ROM.
- Spectrum BASIC was very slow especially compared to BBC Basic. I think that this was partly due to the constraints of having to fit everything into 16k vs 32k for the BBC - so code was optimised for size rather than speed.
- It included a stack based VM for floating point operations which I think was again mainly to reduce the code size (one byte for each operation rather than three bytes for a subroutine call).
Would seem appropriate to give credit to the main author of the code, Steve Vickers [1], who went on to found Jupiter Computing, makers of the Jupiter Ace.
[1] https://web.archive.org/web/20110516082258/http://www.sincuser.f9.co.uk/004/newbiz.htm https://web.archive.org/web/20110516082258/http://www.sincus...
edit: added Steve Vickers credit.
- acqq 6y ago> Spectrum BASIC was very slow especially compared to BBC Basic. Yes. The commercial games were all assembly anyway. The BASIC was just to get the idea what is possible, assembly to achieve the speed. > a stack based VM for floating point operation Of course, even Intel 8087 FPU chip and all the FPU operations is x86 before the introduction of SSE2 were done based on the stack based code and operations. Stack based calculations indeed allow amazing code density.
- rahimnathwani 6y agoNot quite all commercial games used assembly. I remember playing and modifying this game, which was written in BASIC: https://en.m.wikipedia.org/wiki/Millionaire_(video_game) https://en.m.wikipedia.org/wiki/Millionaire_(video_game)
- tromp 6y agoI just looked at my bookshelf and found it standing next to "Spectrum machine language for the absolute beginner" edited by William Tang, also by Melbourne House Publishers. Good memories...
- Theodores 6y agoThe Spectrum used the CPU and the ULA for everything. This resulted in a cheaper price for the machine. Meanwhile the BBC had actual hardware. As an example a simple beep would tie up CPU cycles on the Spectrum whereas the BBC micro could define a sound envelope for something more than a beep and hand that off to the AY-8192 sound chip. The Z80 had plenty of features that the BBC micro's 6502 did not have, so the code should have been quicker with fewer CPU cycles used and fewer lines of code. But the lack of supporting hardware negated this gain. BBC BASIC was also a more complete implementation of the language. So any code written in BASIC was more efficient just because you didn't have to use your own BASIC workarounds. Being able to drop into assembly language also helped, the Spectrum lacked this option to truly turbo charge your code. The BBC used 16k for BASIC in ROM and had 16k for the OS. This enabled ROMs to be swapped out so you could run BCPL or another ROM, e.g. Fortran. The Spectrum had BASIC and the OS in 16k with 48k available for RAM. The BBC could use more than 32k of RAM if installed, as per the later Master system that used bank switching. I am not familiar with the code but I would be surprised if the BBC Basic ROM was anything less than a work of genius concise code. Every byte counted in those days regardless of what home computer you were programming for.
- jlarcombe 6y agoYes, also no contention for video memory access on the BBC.
- beagle3 6y agoThe spectrum also had contention for video memory access; The memory map was: 0->16K: ROM 16K->32K: "Slower" RAM (ULA/Video has preference so may delay CPU) 32K->64K: "Faster" RAM (Same RAM, but nothing other than CPU accesses it)
- jlarcombe 6y agoYes - that's what I meant - sorry if not clear. BBC ran at full speed all the time (except when interfacing with 1Mhz peripherals). Spectrum clock speed higher but contention for video RAM. Also traditionally the 6502 is regarded as having greater throughout for same clock speed (something to do with the width of the ALU and the complexity of instruction decoding?)
- pjmlp 6y agoI only managed to grasp Z80 on the Speccy after getting hold of that book on the local library, unfortunately by then I was already getting into 8086 Assembly, so it felt like a lost opportunity. Using hexadecimal monitors wasn't that appealing to me, specially trying to find out why a checksum row wasn't correct. Much worse than finding errors on BASIC listings.
- rwmj 6y agoI attended lectures from Steve Vickers on Mathematical Structures in Computer Science, which is to date the hardest course or study I have ever done. I mean, I have studied advanced logic, pure maths, electronic circuit design and those were all a walk in the park compared to this. If you want to get a taste of how difficult and abstract the topic is, have a look at some of his papers, eg: https://www.cambridge.org/core/journals/journal-of-symbolic-logic/article/sublocales-in-formal-topology/31D6795D9773BA4E28E59AE83F6637BF https://www.cambridge.org/core/journals/journal-of-symbolic-... or https://scholar.google.com/scholar_lookup?title=Topical+categories+of+domains&publication+year=1999&author=Vickers+S.&journal=Mathematical+Structures+in+Computer+Science&volume=9&doi=10.1017/S0960129599002741&pages=569-616 https://scholar.google.com/scholar_lookup?title=Topical+cate... Sadly I didn't get him to sign my original copy of the ZX81 Manual :-(
- derefr 6y agoRe: that first one, I have no idea what I just read, but it conjures back to mind a philosophical pondering I had once, on the intended formal-relational-algebra meaning of a record not being present in an RDBMS table. I.e. "Does non-presence of an asserted relation, mean the relation is instead refuted (i.e. is this table a total membership-function for a set whose members are its present rows)? Or does non-presence of an assertion of a relation mean that this system just hasn't been informed of that assertion, and is in a default state of not-knowing the truth value of the relation (i.e. is this table a partial membership function, defined only on asserted relations)?" Or, to put that another way: if you were to create an RDBMS that "correctly" reflects formal relational algebra, then should a search query looking for P(X), which you haven't asserted to be true, be "satisfied" to say -P(X); or should it be "unsatisfied" / non-halting, because whatever answer it would give could potentially be wrong in the face of later learning? ...does that question have something to do with the concept of "open" vs "closed" sublocales, or am I way off?
- rwmj 6y agoIf it's any consolation, even after doing the course I don't know either.
- beardyw 6y agoI am now retired and have kept only 4 or 5 technical books. This is one of them. The elegance of this code is in the way it fulfills its role and fits in the space available.