3 ms·
"Game Boy consoles use a custom Sharp CPU core that resembles Z80 and 8080 but is not exactly either." - well said but do know that the Z80 resembles the 8080 a
by djmips 4y ago
"Game Boy consoles use a custom Sharp CPU core that resembles Z80 and 8080 but is not exactly either." - well said but do know that the Z80 resembles the 8080 and it isn't exactly an 8080. To be fair the SM83 as coined here does have a few Z80 instructions but by and large it is an 8080 clone.
- NieDzejkob 4y agoThe name didn't get coined here - there are Sharp datasheets documenting this core, and they use the name SM83.
- phire 4y agoI've always liked to think of the SM83 as an 8080 clone that happens to use z80 assembly syntax (and includes a few z80 instructions) But it's not really accurate to call it a clone of anything. It seems to be more of a unique CPU design that happened to steal opcode and semantics from both the 8080 and z80.
- flohofwoe 4y agoThe Z80 fills some redundancies and gaps in the 8080 instruction set and adds the concept of prefixed instructions (via the CB, DD, FD and ED prefix bytes), but is otherwise compatible with the 8080 (it can run 8080 code which doesn't use any of the redundant opcodes which have been repurposed in the Z80). Looking at the Gameboy CPU instruction matrix (https://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html https://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html) versus the 8080 matrix (https://pastraiser.com/cpu/i8080/i8080_opcodes.html https://pastraiser.com/cpu/i8080/i8080_opcodes.html), the Gameboy CPU looks a lot more like a Z80 than an 8080. For instance the Gameboy CPU has the conditional relative jump instructions (like JR NZ, JR NC, ...) of the Z80, while the 8080 only has redundant NOPs in those instruction slots. Also while the Gameboy CPU is missing the DD, FD and ED prefixed instruction ranges, it has the complete CB-prefixed 'bit twiddling' instruction range of the Z80). So IMHO it's more correct to call the Gameboy CPU a stripped down Z80 than an extended 8080 (but of course the Z80 is also "just" an extended 8080, so it's also not wrong to call the Gameboy CPU an extended 8080, the 8080 is basically the grandfather, and the Z80 the father).
- djmips 4y agoOh please, the big improvement in the Z80 over the 8080 was the IX and IY instructions plus the alternate register set 'AF etc and that's completely absent in the Gameboy CPU. The Z80 is not the father of the Gameboy CPU. A+B-B = A The Z80 has some influence but it's pretty small.
- flohofwoe 4y agoI wouldn't call the IX/IY instructions an improvement. They were so slow that they've rarely been used in performance-sensitive code (like games), it totally makes sense to drop them in a gaming device. Same for the block instructions in the ED instruction range, quite convenient, but also very slow. LDI/LDD might have been useful for blitting bytes in unrolled loops, but since (AFAIK) the GB video hardware renders tiles and sprites directly, there's hardly a need for copying lots of bytes around. The shadow register set wasn't all that useful either except for quickly saving state in interrupt handlers, but the additional registers take up a lot of die space. On the other hand, the entire block of 256 bit twiddling instructions were obviously deemed important enough to keep them in the Gameboy CPU.
- djmips 4y agoSo you're basically saying you use a Z80 like an 8080. That's fine.:) But I will admit that the CB array of instructions are quite useful and Z80 in origin. But just because you don't like a bunch of the Z80 die doesn't mean that the SM83 is a Z80 though. It's basically just an 8080 + CB and instructions that appear neither in 8080 or Z80 Still - I can see both from both sides now.