opinali
Joined 15 years ago
Joined 15 years ago
That was a powerful hacking/debugging/programming utility. I am still proud of the HILOAD command which was capable of loading files from tape in any condition: if any error was found, this command would fill a separate buffer with the relative address of every error. Then you could use other commands to inspect the data and painstakingly recover it by guessing the correct value for damaged bits or bytes (they utility could dump memory in many ways, including some popular encodings of sprites for games). There was also a whole-block SHIFT command useful for this task because a loading error could make all following bytes to be shifted left or right some bits, because the tape data format didn't have a byte-boundary delimiter, it was just a stream of bits.
The IX/IY registers are heavyweight but one needs to remember the "best-practices" of that era and architecture. In well optimized Z80 code, the IX/IY registers are often used for critical "global variables" that you can keep all the time in registers across many subroutine calls (think "segment registers": base pointers for important tables or buffers that are not fixed addresses through the whole program). Their performance beats needing frequent indirect load/store from pointers stored in memory via other registers that often need to be preserved/restored.
You can also use some relatively low-latency instructions that involve IX/IY, in particular PUSH/POP were often used in optimized buffer-copy routines: you burn all registers to fetch up to 20 bytes of contiguous data with POPs, then you patch the SP register and issue PUSHs in inverse order to store those 20 bytes in another location; loop if needed for >20 bytes, even with loop overhead this is faster than LDIR/LDDR. Games used that trick all the time for block copies like sprite bitblt or double-buffer animation.
I'll be more convinced by realistic benchmarks, and yes the Fib2 that I quoted before is not impressive even for the standards of CPU microbenchmarks, but maybe someone would know some real-world code that had good ports to both CPUs and could give a better verdict. Unfortunately games are never good choices, the 8-bit systems had radically different architectures for essential features like video and audio so "ports" were often full rewrites even at a high level like rendering strategies... there might be exceptions, like the AI component of a chess game.
For one data point in performance, theultimatebenchmark.org has some Forth benchmarks that apparently show a 4GHz Z80 beating the 6502 by 2X (best scores for each: mc-CP/M Z80 4Mhz / FIG-Forth 1.1 / Fib2 = 1m19s, Apple II 1Mhz / Apple GraForth / Fib2 = 2m19s).
Disclaimer: biased, veteran Z80 / ZX Spectrum programmer ;)
And to be fair with Asimov, he saw some of that for example with "U.S.Robotics", a fictitious private company that invented the positronic brain and had a monopoly on that business. Also, his Encyclopedia Galactica is the creation of a large group of "encyclopedists" who are basically academic elites, something we could see as a Wikipedia-like except that it wasn't produced by millions of joe schmoes but rather by a kind of priesthood of professional intellectuals. (Foundation makes these people work in a centralized organization, but that happens in a late period of the galactic empire, it's my impression that the origins of the Encyclopedia are way more descentralized.)
And then of course, the military chain of command is exceedingly good at diluting responsibility -- generals will demand results implying but not writing down how far commanders can go; soldiers and commanders will cross many lines which no colleagues will report() and no immediate superiors will punish; the press will be strictly managed to not see anything that "national security" doesn't need us to see so our own civilian population will be morally appeased that we're being righteous, everyone is happy.
() A few will do, and then they're jailed for life as traitors.