Z80、6502及其它处理器之间的比较
作者在为 Exidy Sorcerer 开发 LZ4 解压缩器时,发现了自己拥有 Z80、8080、8086 以及 6502 四种不同处理器的解压实现。
文章旨在对比这些处理器之间的联系与区别。
Z80 是 8080 的二进制兼容升级版,它去掉了相对跳转指令(JR、DJNZ)、影子寄存器、多字节指令等功能。
而 8086 则是在 8080 的设计基础上构建的 16 位处理器,它拥有更大的内存寻址空间(1MB)和更灵活的寄存器使用方式,尽管它的分段机制颇受争议。
文章分两期发布,本期侧重于比较 CPU 的架构特点,下期将分析具体实现细节。
查看原文开头(英文 · 仅前 3 段)
Last week’s adventures with the Exidy Sorcerer led me to write a Z80 version of the LZ4 decompressor I’d previously used on the SNES, the CoCo, and the Genesis. At this point, this has become generic enough that I took my previous implementations and broke them out into their own little library directory so I could use them in other projects. The SNES implementation turned out to be too tightly tied to the project it was in to be made generic, but the other three were just fine.
However, while I was looking at those implementations, I rapidly found that I had not three implementations, but six; the Z80 implementation inspired versions for the earlier Intel 8080 and the later Intel 8086, and I felt the lack of a dedicated 6502 version and wrote a decompressor there as well.
My original plan was to present all four new implementations side by side as a way of highlighting the similarities and differences between the various CPUs, with maybe a little historical scene-setting at the start to map out the relationships between all the various chips. This got entirely out of hand so I’ve split it in two; this week’s article is just about comparing the CPUs in their context, and next week I’ll dig into the implementations as a worked example of why these differences matter.
※ 出于版权考虑,仅引用前 3 段。完整内容请阅读原文。