Zilog Z80: Difference between revisions
mNo edit summary |
m (→Registers) |
||
Line 129: | Line 129: | ||
As on the 8080, 8-bit registers are typically paired to provide 16-bit versions. The 8080 compatible registers are: | As on the 8080, 8-bit registers are typically paired to provide 16-bit versions. The 8080 compatible registers are: | ||
* <code>AF</code>: 8-bit [[ | * <code>AF</code>: 8-bit [[accumulator]] (A) and flag bits (F) carry, zero, minus, parity/overflow, half-carry (used for [[Binary-coded decimal|BCD]]), and an Add/Subtract flag (usually called N) also for BCD | ||
* <code>BC</code>: 16-bit data/address register or two 8-bit registers | * <code>BC</code>: 16-bit data/address register or two 8-bit registers | ||
* <code>DE</code>: 16-bit data/address register or two 8-bit registers | * <code>DE</code>: 16-bit data/address register or two 8-bit registers |
Revision as of 23:04, 4 November 2023
General information | |
---|---|
Launched | March 1976 |
Common manufacturer(s) | |
Performance | |
Max. CPU clock rate | 2.5 MHz to 20 MHz |
Data width | 8 bits |
Address width | 16 bits |
Architecture and classification | |
Instruction set | Z80 |
Physical specifications | |
Package(s) | |
Socket(s) |
|
History | |
Predecessor(s) | |
Successor(s) |
The Zilog Z80 is an 8-bit processor that is a software-compatible extension of the Intel 8080. In addition to having a binary compatible ISA to the 8080, the processor offered many different improvements which allowed the Z80 to become the most widely used CPUs in desktop and home computers from the 1970s to the mid-1980s.
Design
Registers
|
As on the 8080, 8-bit registers are typically paired to provide 16-bit versions. The 8080 compatible registers are:
AF
: 8-bit accumulator (A) and flag bits (F) carry, zero, minus, parity/overflow, half-carry (used for BCD), and an Add/Subtract flag (usually called N) also for BCDBC
: 16-bit data/address register or two 8-bit registersDE
: 16-bit data/address register or two 8-bit registersHL
: 16-bit accumulator/address register or two 8-bit registersSP
: stack pointer, 16 bitsPC
: program counter, 16 bits
The new registers introduced with the Z80 are:
IX
: 16-bit index or base register for 8-bit immediate offsetsIY
: 16-bit index or base register for 8-bit immediate offsetsI
: interrupt vector base register, 8 bitsR
: DRAM refresh counter, 8 bits (msb does not count)AF'
: alternate (or shadow) accumulator and flags (toggled in and out with EX AF,AF' )BC'
,DE'
andHL'
: alternate (or shadow) registers (toggled in and out with EXX)- Four bits of interrupt status and interrupt mode status
The refresh register, R
, increments each time the CPU fetches an opcode (or an opcode prefix, which internally executes like a 1-byte instruction) and has no simple relationship with program execution. This has sometimes been used to generate pseudorandom numbers in games, and also in software protection schemes. It has also been employed as a "hardware" counter in some designs; an example of this is the ZX81, which lets it keep track of character positions on the TV screen by triggering an interrupt at wrap around (by connecting INT to A6).
The interrupt vector register, I
, is used for the Z80 specific mode 2 interrupts (selected by the IM 2
instruction). It supplies the high byte of the base address for a 128-entry table of service routine addresses which are selected via an index sent to the CPU during an interrupt acknowledge cycle; this index is simply the low byte part of the pointer to the tabulated indirect address pointing to the service routine. The pointer identifies a particular peripheral chip or peripheral function or event, where the chips are normally connected in a so-called daisy chain for priority resolution. Like the refresh register, this register has also sometimes been used creatively; in interrupt modes 0 and 1 (or in a system not using interrupts) it can be used as simply another 8-bit data register.