Have to upvote - just because Z80: I spend my youth programming this thing literally in hex: To program my Amstrad CPC646, I wrote down opcodes on a piece of paper and then manually translated to hex according to a copy of the Z80 spec sheet I found in the back of some book. Relative jumps were especially fun...
If only I had had the internet, maybe I would have stumbled on the concept of an "assembler". Not sure if it had been more fun? In any case, I did not find the protected mode.
Because, unless I'm misunderstanding the video, it doesn't exist until you add a whole bunch of external hardware (which is why the video is clickbait - a fact he acknowledges later.)
Sure, but if memory serves me correctly, many early workstations used a microprocessor with an external MMU. It is misleading in the sense that it is not part of the Z80, but it is in the character of the times. (And MMUs are not the only CPU feature that was originally external. The FPU is an example that more people will be familiar with since it was an upgrade path available on many personal computers.)
For example a Programmable MMU was an optional add on for the Macintosh II (which wasn’t a z80 but serves to illustrate the time when they began to become available to home computers)
I mean, true, but "a whole bunch" is kind of misleading. It's a really clever hack using really a tiny amount of extra gates. It's still a very cool and innovative hack that nobody really had thought about before.
Reminds me of the printer interrupt hack Darklite/Offence used for their Tiki-100 demos.
The Tiki-100 is an obscure Norwegian 8-bit computer from 1984, also Z80-based. It had nice graphics for its time, with 16 colours from a 256-colour palette. However, it was very hard to use productively, since the machine had no video sync interrupts.
What the guys in the demogroups figured out, was that it did have parallel port interrupts, and with a tiny hardware mod (just a wire from the expansion port to the parallel port), they could "steal" those for Commodore 64-style raster interrupts.
It certainly has been thought of before. Using external circuitry to remap the address space was common with lots of different processors, and once you have that (and a way to jump to a controlled address from hardware) it's a logical next step.
That it wasn't something usual with microcomputers of the time wasn't because it would have required some uniquely clever design. Rather it had to do with them being single-user/single-task, with simple operating systems where programs were expected to have full access to the machine.
Yes, there were lots of 8-bitters that used bank switching. But I think you have the causality somewhat backwards. 8-bitters didn't lack memory protection because they didn't have operating systems that could use it; rather, their operating systems couldn't use it because it wasn't there. Multitasking was of course useful, then as now, and sometimes people did do multitasking on them despite the generally limited memory; it was just less reliable because programs could crash each other. Multitasking was common in real-time control, which is how THERAC-25 happened (on a non-8-bit machine, but due to a race condition between threads).
A common use for multitasking in the 8-bitter era was print spooling; it was very inconvenient to have to wait for your document to finish printing before you could continue editing! People frequently bought external hardware printer spooler boxes to connect between their computer and printer because of this. Similarly, duplicating floppies was pretty inconvenient because you couldn't do anything else while it was happening, even if you had four floppy drives like I did, with literal megabytes of storage space available to read porn or play video games while the floppies were copying.
Historically on larger machines it was also common to use multitasking to overlap very slow disk I/O with useful computation. (The alternative is to use asynchronous I/O and write your program as an event loop, like a game or Node.js, or to do your I/O from interrupts, which is close to multitasking.) In theory this could have been useful on 8-bit micros as well but I don't think I saw any cases of it actually happening.
Using external signals for some sort of protection isn't innovative. This is a documented feature of the Intel 8086: the S3 and S4 pins expose which memory segment is being accessed: code, data, stack or extra segment.
Yeah, but as the author says, it renders the whole maskable interrupt system useless… so it is not something you would do since it would undermine too many useful parts of the chip.
It's not uncommon for chips to support configuring different features by wiring in external components. Though usually they are passive components, this isn't completely absurd.
> until you add a whole bunch of external hardware
Why mind this if the hardware to add is the same level of technology like Z80 itself? I would be glad to build a computer as advanced as possible combining some Z80s and additional HW.
> Why mind this if the hardware to add is the same level of technology like Z80 itself?
But it's not "the Z80's protected mode" - it's "the Z80 + an extra circuit to emulate protected mode". It's a super clever hack, yes! But filthy clickbait also.
I did a lot of that on my CPC464 and TRS-80 too. Thanks for rekindling the memory. Relative jumps were the easiest way to make code relocatable, but you were limited to +/- 128 for an offset.
I used the "Programming the Z-80" book by Rodney Zaks, which is still on my bookshelf. Some manuals just can't be disposed of!
From memory I recall my favourite instruction - LDIR (Z80 block memory move) is EDB0, and JMP is CA.
Slightly more on topic, I piggybacked a 2716 EPROM onto the back of the TRS-80 ROM so I could get to the previous hard-coded RST locations and interrupt vector of the Z80 processor. In a nutshell, that allowed me to stop/debug/hack running programs without software being able to prevent me.
I used the "Programming the Z-80" book by Rodney Zaks
I have that and the 6502 book by Zaks also. I read those books when I was a teenager as if they were tomes filled with wisdom of the ancients. I protected them with plastic book covers and wrote my own notes in the margins in pencil. I worked a Saturday job when I was 16 and spent the money on them. At the time they were so expensive!
Curious note: the opcode space of the Z80 was best viewed in octal, not hex. The first 2 bit decoded the instruction class e.g. 01 was the MOV set of instructions. The next 3 bits were register destination; the last three were register source?
Registers were numbered [0-7] b,c,d,e,h,l,m,a if I remember right. h and l were 'high' and 'low' part of the 16-bit indirect 'm' memory address.
So in octal, 134 was "mov e,h".
You now know 1/4 of the entire Z80 instruction set!
I never understood how the English, and sometimes the Dutch, seemed in general (looking at their results) to be able to learn many times faster than amateurs in other territories. Sometimes with borrowed machines! "They gave me this, and after some weeks I had my first videogame working". I guess/ed it may have been a matter of human network - of being able to find knowledgeable people in the neighborhood to learn and exchange -, but it seems to have been often a solitary effort. It seems in a way like a talent, like that of the Scots for inventions, but there have to be keys that made kids talented coders through their own natural grit.
Others have had difficulties in finding documentation alone, not to mention competent peers.
I wonder if the presence of other machines in the market made things like assemblers more well known in the UK.
i.e. BBC Micros came with an assembler so it's the kind of thing BBC users would tell CPC464 users about and they would then buy third party.
Why did the BBC Micro have an assembler? Well the people made it started out in a university setting with access to all sorts of things that they wanted on their small computers.
E.g. BBC Micros had networking before most other 8-bit machines simply because the original developers had used it in a research lab.
In other markets you might just be working on your own and so wouldn't know about things like networking because you wouldn't have an immediate need for it.
To quote William Gibson, the future is here already it's just poorly diffused.
It was a short hop from picking up Castle of the Winds II at a dollar store to finding out about resource editors and win32 when I wanted to edit the images. The game itself was from 1993, but this was in the late 90s/early 2000s when you could Google stuff like this and land on programming forums. And likely a post from someone else who wanted to do the same thing.
I still had to know about it. If I'd never found Rick Saada's experiment in win32 packaged as a game for a dollar, would I know about any of this? I wonder if the growing availability of the internet has closed the gap any.
I don't know why I remembered it as win32 from when he wrote about it. Anyway. I remember downloading a save editor from AOL's software center, so the stuff on that page brings back memories. I had a broken 10+ MB save from trying to get every item and explore every block in every dungeon. I'd pile stuff up by category in the middle of town.
I think it is also because of the game publishing industry.
I made a Tetris clone in Pascal, running in a 286 machine with 1 MB of RAM. It took me about a week of coding, and it ran as a single segment program, so it was limited to 64Kb of memory.
For me, this was the moment I learn about for loops. The program was a big collection of for loops.
I could have made some original game, but being Colombian, living in Bogotá, no one would have bought it. Everything we had was pirated, so there was no incentive to actually publish anything.
Speaking as a Brit. I don't think we have the capacity to learn many times faster.
I suppose there is something in our culture. A lot of inventions and science has come out of the UK.
There's also an (I assume) cultural phenomenon of tinkering in the garden shed.
I suppose there's the Protestant work ethic, the ethic of self improvement, a general acceptance and perhaps celebration of odd balls and tinkerers.
It the field of computing, it probably helps that we speak the same language (ISH) as the us, where a lot of this tech came from, but didn't have the money to just buy solutions.
But I don't really have any experience of other cultures in this context to say whether these things are unique.
> a general acceptance and perhaps celebration of odd balls and tinkerers
Paradise! (No, really, that is respectful and intelligent - if in general people can perceive that "the guy has something", that is already a big social asset.)
> other cultures
Other cultures may be quite diffident and promoting different "values" - in the streets you will more often find "socialites". At the extreme, a Siberian once told me: "They would go and beat up the different. «You are different», they would say, and beat you up".
>It the field of computing, it probably helps that we speak the same language
Then again, I think working through untranslated English material for my computer hobby helped me gain language proficiency more quickly than many peers.
True. But if I'm reading z80 documentation, I'm going to be able to read it more easily. Plus I don't have to be also willing to learn a second language.
Of course in the end you have computing skills and a second language.
Slightly off topic question though.
Are programming constructs based around or influenced English making it easier to learn as an anglophone?
Would (true)if be more common, or do{}while(true) be more common if English weren't the Lingua Franca?
I know you could find examples of these in many languages, but they aren't 'standard'
For me, as a kid back then it was the magazines. I would wait all month and then devour the latest Felix Denis publication end to end. The editors of these magazines could be considered the orchestrators of the UK 8 bit scene. Manuals were out of my financial reach.
>I never understood how the English, and sometimes the Dutch, seemed in general to be able to learn many times faster than amateurs in other territories.
I don't think that's the case, I think it's that the achievements form the English and the Dutch are shared on the English speaking internet so it's more easily to run into them VS for example, the German speaking hackers who, at least in the past, only shared their work on the German speaking internet instead, so their achievements are less likely to get international visibility.
It's the same with other cultures that have a huge population/market share. If you'd venture on the Russian speaking part of the internet, you'll find a gold mine of hacks, cracks, reverse engineering, and crazy software that flies under the radar.
Products were sold in shops and via mail and were advertised on magazines. Remote networking was on Bulletin Board Systems - and with limited diffusion. The hacker coding his¹ product probably did not easily have those things around.
¹(A 'his' that calls for a pluralized 'her', out of respect to a group that created a closed-doors women-only community in Ireland and produced "women-only" themed adventure games: they were in a way similar to a sect but sold their own software as part of the funding - I cannot remember names right now. I believe there exists a photo of a group of coders with two ladies dressed in Victorian costumes (which apparently were the uniform in said community), after a social gathering. This gives an idea of what could contribute to the scene. Edit: found: it was the "Silver Sisterhood", in County Donegal - https://en.wikipedia.org/wiki/Silver_Sisterhood )
I think it was because in the 80's the US was wealthier and systems with disk drives were a lot more common.
People would swap games on disk, and there was less pressure to learn how the underlying system works.
Having a disk drive also enables more complex, larger games, which would be harder to produce as a lone programmer.
Contrast this with the UK - we had much less money, it was common to type games in from magazines, which is how a lot of us learned programming.
We mostly had to make do with tapes, which limits the size of a game and its sound and graphics to physical RAM. It was entirely possible as a lone programmer to create a commercial level game with a few weeks of late night hacking.
Here's one example of a network effect that happened without actually meeting other people: I certainly wouldn't have considered spending my pocket money as a thirteen year old on a new copy of the Zaks Z80 book, but I stumbled on a second-hand copy in a charity shop for a few pence.
I’ve found that there are oddballs in just about every culture who make new things. Some cultures celebrate them, others don’t. The most tolerant cultures tend to get the most interesting new art.
Edit: corollary, some of the best new art happens in the most restrictive environments. Maybe it’s a case of living at the extremes?
I think that some environments raised kids to be grittier, more focused on getting results (and less e.g. prone to consume time in entertainment).
> some of the best new art happens in the most restrictive environments
You reminded me of Paul Buchanan, frontman of The Blue Nile, revealing that they would compose and rehearse standing shoulders to a wall in a narrow corridor in a house in Glasgow - that was the room they had.
I grew up real poor and it made me hungry. I think that's where a lot of the hacker mentality comes from, one form of poverty or another.
I am hoping to raise children soon and I am wondering how to help them to feel a hunger for the world without suffering in the same way I was raised. It's hard for me to imagine how they'll learn to thirst for the experience of the world if they don't have the same socioeconomic pressures, but I think that will be one of my most profound growing experiences in this life. I intend to accept them for who they are and to try to give them as much opportunity as they can stomach.
I guess it may help achieving Goethes “In der Beschränkung zeigt such erst der Meister” (“the master shows himself through restriction” / Antoine de Saint Exupery’s “la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher” (“perfection is not achieved when there is nothing left to add, but when there is nothing left to take away”)
If you have little to work with, adding stuff often forces you to remove or shrink something else.
Just for context: I grew up in a small village in Denmark. My window to the world was one-hour bus trips to the nearest town which had a decent library, including some computer magazines.
None of my peers did any programming, and since Denmark does not have flat-rate local calls, calling up via modem to connect to a BBS was never really an option -- so there was really no-one to share with. That is certainly somewhere were the internet would have been a plus.
I'm sure media coverage helped. Back in the 8-bit days in the UK there was a regular BBC TV show for computer buffs that introduced a lot of the concepts, and each platform had a minimum of one glossy magazine per month full of tips and info - I remember reading about assemblers for both ZX Spectrum (Z80) and Atari (6502) in these kind of publications, that were widely available at regular newsagents.
There’s an Russian-language memoir[1] by Kronrod (of the ITEP programming school that also includes Adelson-Velskij and Landis of AVL fame and served as the birthplace of ABBYY some decades later) that mentions that for some time, they did things exactly that way, and that it was a small breakthrough to be able to talk about symbolic variables and draw jumps graphically once they had explained to the secretarial staff how to translate that into addresses. So, taking into account the lack of accessible reference material, you are in good company :)
(The book also includes a discussion on VLIW-style microcoding, a plea for more registers, and a note how a population count instruction may be worth including despite its situational utility because of how easy it is to do in hardware compared to a software emulation. That team did one of the first chess programs, though, so it’s not surprising popcount came to minds easily.)
The ZX81 and ZX Spectrum manuals had the character code table (ASCII-ish on the Spectrum, something totally different on the ZX81) alongside all the Z80 mnemonics and their hex and decimal values in the back.
I think the Jupiter Ace manual might have had that too, but it's been a long time since I've even seen my copy of that.
Yep, I still know all the hex opcodes of the z80 (MSX) now so many years later. It was nice; just type them in basic, poke and go. I never, at that age, knew the assembler equivalents and didn’t know it was a think until many years later. I learnt c and pascal before having an actually z80 assembler. After that I moved on to Amiga where I did learn 68000 instructions to make demos and games.
I had Discology, it had built-in disassembler. So I wrote a binary file like 00 00 01 00 00 02 00 00 03... and disassembled, and put in a notebook what code produced what command (then adding different arguments than all zeros, then finding longer opcodes and generating a new file for them...)
I knew what an assembler was (because my friend who had a C64 had one), but it was too darn expensive, so I wrote one myself in MSX BASIC :) Though it was very primitive, and didn't implement much more than an opcode table and a load and save to tape feature.
I bought one from a classified in a computer magazine. The guy who sold it had written it himself, in hand assembled machine code. I knew there existed other assemblers, but I couldn't find any to pirate or buy.
I didn't have a disk drive, only the standard cassette deck, so before selling it to me he had to slightly rewrite the assembler to support loading and saving programs to cassette.
In the end, the syntax was not exactly like in the Rodney books. Some examples worked, some not, so I resorted quite a bit to hand assembling myself.
As I had the Rodney book (and no disk drive: it was twice as expensive as my computer!) at least I implemented my assembler as the one from the book :)
My “paper programming” experience was about the same, but on the Vic-20 and Commodore-64. Only later did I realize the mnemonics could be coded directly, rather than me getting the decimal opcodes from a table and POKE-ing them into memory.
I did the same, but with an Oric Atmos (6502). It came with an amazing manual, which I've recently had another look at. It taught BASIC, character graphics, machine code, binary and how negative numbers are represented, memory addressing, addressing modes, registers, and the instruction set, explaining each instruction, the machine's memory map, ASCII, lists of binary, hex and decimal conversions and tables of op-codes, ROM routines with call and return parameter registers, circuitry of the machine, and a decent index. I think I learnt more about computers from that book than from any other.
(I forgot it all. It's been 35 years ago last I did this and high school mostly crowded it out of my memory. But C9 was RET, that I still remember. ZX Spectrum, for me. But Z80 manual (dis)assembly nonetheless.)
I joined the fray later, in the early 1980's. I had access to public libraries, computer magazines like Byte and Creative Computing, computer stores with software, books and magazines, dial-up BBSes, computer expo events, enthusiast meet ups and swap meets, ...
Though knowing what an assembler is didn't translate to easily getting one.
I used an interactive instruction-at-a-time assembler inside the Apple II+ ROM. This was a small level above entering hex. MS-DOS had a similar facility in DEBUG.COM.
Eventually I got my hands on a copy of Randy Hyde's LISA (Laser-Systems Interactive Symbolic Assembler), and was able to make larger, more complex programs.
I did that too, on a ZX80 back. Well after a week of doing it using a book and caclulating relative jumps (the backawards ones were worse) by hand I thought "there has to be a better way" and wrote my own assembler in BASIC (but I didn't know it was called an assembler at the time)
I feel you pain, using DATA statements in BASIC, or monitors, as I could not yet afford buying a nice Assembly editor at the time, and there wasn't none I could find on local shops, importing it from some UK store would have been the option.
This was the tersest possible listing of opcode mnemonics :/
I cobbled together a basic understanding from various machine code listings (Toni Baker, Your Sinclair IIRC), and my "assembler" was paper, pencil and a FOR/INPUT/POKE loop...
My uncle loaned me a Sharp MZ700 one summer, its manual had a detailed breakdown of Z80 opcodes (in mere 4 pages) which was a revelation to me, and an annotated monitor in assembler.
https://archive.org/details/sharpmz700ownersmanual (p160-)
Ok... not a hidden feature of the Z80 that hadn't been discovered until now, just a creative way to use existing features and a special address decoding hardware, still clever though.
At 12:10: "Nonetheless, I have made a clickbait video, the type of video that I hate to see" the meta goes deep :D
It's a shame but a necessary evil. I have seen multiple electronics/retro gaming channels messing about with titles and thumbnails to test what attracts the most views.
The general consensus seems to be they wish they didn't have to, but you've got to earn a living somehow
It goes both ways, I gotta avoid clicking on anything that looks like it might be clickbait, dislike anything that fools me. My time is more valuable than the penny they get from the ad view.
And flagged this for it. No tolerance for this kind of crap, the guidelines are clear, the original title being false or misleading is when you shouldn't use the original title. The author took a calculated risk. Without the clickbait, some would never have seen it. With the clickbait, others such as myself will resent them for it. I hope for his sake he made the right choice.
That's one reason why I will likely never become a parent. I don't want to inflict on anyone the need to somehow earn a living in a world of too many other people trying to do the same.
Alternately, you could make enough money that you are able to bequeath upon your ilk sufficient money to not need to worry about it too much.
Though if you're doing this, highly recommend not letting them realize you're fairly well-off until they're old enough to know the value of a buck/peso/ruble/euro.
If you're interested in secrets for the Z80, shameless plug ! I gave a talk at FOSDEM this year on secrets that were discovered 30-36 years after its release (MEMPTR and some of SCF/CCF behavior): https://archive.fosdem.org/2022/schedule/event/z80/
There are even more secrets that were discovered in recent years that aren't in the talk.
Despite giving a talk, I'm not an expert on the subject, but if you look at ZX Spectrum forums and the ZX Spectrum discord, you'll find more information: the block instruction flags, the NMI preservation during reset, SCF/CCF flag instability.
I haven't researched any of those yet, but many have and did publish those results ! redcode's Z80 emulator seems to be the most up-to-date on those subjects: https://github.com/redcode/Z80/blob/master/THANKS (has many links to the various reverse engineered parts).
> In 1975 Federico Faggin who had had worked at Intel on the 4004 and its successors left the company and joined forces with Masatoshi Shima [] from Zilog. At their new company Faggin and Shima designed a microprocessor that was compatible with Intel’s 8080 (it ran all 78 instructions of the 8080 in almost the same way that Intel’s chip did)1 but had many more abilities (an extra 120 instructions, many more registers, simplified connection to hardware). Thus was born the mighty Z80! and thus was the empire forged
Title is misleading (he even admits it later on in the video), nothing hidden was discovered, it explains how to add extra circuitry to simulate protected mode. Jump to 04:11 if you want to see what this is about.
Correction: you can do pre-emptive multi-tasking on z80. I wrote an OS to take advantage of this back in the day. It has interrupts, after all. User programs (as it were) can disable interrupts, but the z80 has NMIs as well if your hardware configuration is suitable for it.
Quite a misleading clickbaity video. There was additional hardware added that provides memory protection. It's been done before. Nice description though.
If he had named the video "Implementing protected mode for Z80 with minimal extra circuitry", I think it would have gained just as many views - maybe not as fast though.
Title is clickbait... the Z80 does not have "protected mode" (x86-specific term), in the video protection of the I/O space is implemented using additional hardware.
People talk about the Z80 supporting bank switched RAM, which also requires a small amount of external logic gates but depends on CPU features that didn't exist in every 8 bit CPU of the time. This feels similar.
It's a z80 upvote for emotional reasons and also for the ingenuity ! The very story of how z80 came to be is amazingly descriptive of how Intel was shortsighted with its designer.
The kid did a marvellous job of presenting information. The excellent technical work is one thing, however the organization and delivery of the material was beyond exemplary.
Quite apart from what others have pointed out regarding the "hidden" feature that isn't, I had homebrew development systems for both Acorn Atom, C64, ZX Spectrum and a few other machines that effectively banked the RAM. There was the main 48KB of RAM on the Speccy, and a further 128KB in banks that stored the assembly program, the editor, and other tools in a protected space. The 16KB ROM was swapped out for a custom blown 16KB EEPROM that performed the copy from banked RAM to the Spectrum's main RAM, and then the custom EEPROM swapped back with the regular Spectrum ROM, and the machine performed a reset/jmp to execute the actual code I needed. This was most definitely not an MMU in the true sense of the word, but it did give access to a "protected" memory space, a dedicated kernel mode effectively, that the regular Spectrum could not access.
BTW back back through the mid 70s it was not extraordinary to add protected mode and pagers to some mainframes and minis yourself. I used several machines that had had locally designed memory management added. So I find this especially nice.
Not to discredit author's huge effort on this, but that part alone lowers the value of this video orders of magnitude solely because of how the video was titled.
I wish they titled it "Make Z80 protected mode capable with a simple hardware change". Setting expectations right is important.
Can’t watch the video right now, but intrigued to know how this could be used, if at all, on my trusty old TI-85. It’d be amazing to be able to hook up a breadboard over the data port to do this kind of thing.
It cannot. This hack depends on being able to insert new logic between the CPU and memory. In the TI-85, the CPU and memory are both part of a single ASIC.
Didn't want to editorialize the Video title, but it's a bit of acknowledged clickbait. It's still a clever protected mode, implemented in simple external hardware that leverages Z80 features. Well worth a watch, if you're into that kinda thing.
In the case of misleading or clickbait titles, my reading of the HN guidelines for submissions [0] is that it’s ok to change the title. And my opinion is that in such cases a more accurate title written by the submitter is better than the original title.
The vid even shows what set of instructions this 'mode' would break. Very nicely done.
Sounds like he is a good EE but was a bit frustrated with the growth of his channel numbers. Think his audience will give him a freebee this one time but do it again and they will nope out.
I don't think it would be. You'd have to detect them on the data bus and also differentiate between data and instruction accesses which I don't /think/ the Z80 does, at least not easily.
6502 has output pins that let you distinguish between instruction fetch, data read/write, and interrupt/reset vector fetch. So you can bank switch based on all that stuff.
6502 doesn't have a pin for "IO space" but you just pick your MMIO range e.g. 0xCnnn on the Apple ][ and a NAND gate on the 2 MSBs and a 3-input OR/NOR on the output and the next two bits gives you effectively the same signal. (or an OR gate on bits 12&13 plus a 3-input AND/NAND on bits 14&15 and the output).
It was common to use 6522 VIA 8 bit output ports to bank switch one or two 4k ranges to allow each such 4k range to access 256*4k = 1 MB of RAM. You could use a 16x8 bit SRAM to do the same thing for the whole address space.
It does have a pin for that (#M1, "machine cycle 1").
Zilog actually designed their peripheral chips to handle the RETI (return from interrupt) opcode specially. On the Z80 itself it does the same thing as a normal RET, but other chips can detect it on the bus and treat it as the signal that their interrupt handler is finished.
I also recall reading about some hobby project to add a PC-relative addressing mode to the 8080 or Z80. A redundant opcode like "MOV A,A" would be used as a prefix, which caused the external hardware to add the program counter to the immediate operand of the following instruction. Can't find it right now.
Using M1 plus the address lines was used to trap on certain addresses on expansion devices for the Spectrum such as Interface 1 or the +D. Then they’d use a line on the expansion bus to disable the standard ROM and substitute their own ROM / static RAM until some other trigger such as an OUT to a port would page the ROM back in.
I guess it’s a short step to looking up memory addresses against a bitmap for validation. I couldn’t tell from the video if this is what he did. Cutting the addresses into pages would let you save or add more levels and I guess you could implement a TLB similarly.
Kind of ridiculous how many other top-level comments there are complaining about the clickbait title when you called it out right here in a level headed way.
It’s like the tweet- and video-ification of online discourse have destroyed peoples’ reading comprehension. (On reflection, though, the average person was never good at it. At least it’s mostly confined to annoyances on the Internet instead of, like, political elections or mob violence, right? Right??)
It's not really that much click-bait either. "Method to implement Z80 protected mode discovered after 40 years" would be more correct, but that's too convoluted for YouTube's algorithm.
That PDF is about undocumented Z80 features discovered over the years. That video is not about "The Z80's protected mode discovered after 40 years…" That video instead should have been titled "My janky hack to isolate Z80 IO space" hence its click-bait title. If it had been titled appropriately I would not have wasted time seeking about looking for the recent discovery. Since there have been pretty astounding discoveries over the years I was pretty upset by the video hoping for a new one. I hope he doesn't pull a stunt like this again.
So I'm scrolling through this and wonder just how useful this info would have been back in the day when we were working with Z80s and came across this:
This section might also relevant even if you don’t do anything with hardware; it might give some insight into how the Z80 operates. Besides, it took me hours to draw this.
I feel so validated because I myself have included content in user manuals for the pretty much the same reason.
If only I had had the internet, maybe I would have stumbled on the concept of an "assembler". Not sure if it had been more fun? In any case, I did not find the protected mode.