As on the 8080, 8-bit registers are typically paired to provide 16-bit versions. The 8080 compatible registers are:
There are seven 8-bit general [[Processor register|registers]] ('''A''', '''B''', '''C''', '''D''', '''E''', '''H''' and '''L''') where A is the primary 8-bit [[accumulator]], eight [[shadow registers]] ('''A'<nowiki/>''', '''F'<nowiki/>''', '''B'<nowiki/>''', '''C'<nowiki/>''', '''D'<nowiki/>''', '''E'<nowiki/>''', '''H'<nowiki/>''' and '''L''''), two 16-bit [[index registers]] ('''IX''' and '''IY'''), two external [[control registers]] ('''I''', and '''R''') and one status register. The six general registers can be used as either individual 8-bit registers or in three 16-bit register pairs ('''BC''', '''DE''' and '''HL''') depending on the particular instruction. Specific instructions allow the use of accessing the lower and upper bytes of the two 16-bit index registers (as '''IXL''', '''IXH''', '''IYL''' and '''IYH''' respectively).
* <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>DE</code>: 16-bit data/address register or two 8-bit registers
* <code>HL</code>: 16-bit accumulator/address register or two 8-bit registers
* <code>SP</code>: [[stack pointer]], 16 bits
* <code>PC</code>: program counter, 16 bits
The new registers introduced with the Z80 are:
* <code>IX</code>: 16-bit index or base register for 8-bit immediate offsets
* <code>IY</code>: 16-bit index or base register for 8-bit immediate offsets
* <code>I</code>: interrupt vector base register, 8 bits
* <code>R</code>: DRAM refresh counter, 8 bits ([[Most significant bit|msb]] does not count)
* <code>AF'</code>: alternate (or shadow) accumulator and flags (''toggled in and out with EX AF,AF' '')
* <code>BC'</code>, <code>DE'</code> and <code>HL'</code>: alternate (or shadow) registers (''toggled in and out with EXX'')
* Four bits of interrupt status and interrupt mode status
The ''refresh register'', <code>R</code>, 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 [[integer overflow|wrap around]] (by connecting INT to A6).
The ''interrupt vector register'', <code>I</code>, is used for the Z80 specific mode 2 interrupts (selected by the <code>IM 2</code> instruction). It supplies the high byte of the base address for a 128-entry table of [[interrupt service routine|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 (electrical engineering)|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.
The ZilogZ80 is an 8-bitprocessor 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.
There are seven 8-bit general registers (A, B, C, D, E, H and L) where A is the primary 8-bit accumulator, eight shadow registers (A', F', B', C', D', E', H' and L'), two 16-bit index registers (IX and IY), two external control registers (I, and R) and one status register. The six general registers can be used as either individual 8-bit registers or in three 16-bit register pairs (BC, DE and HL) depending on the particular instruction. Specific instructions allow the use of accessing the lower and upper bytes of the two 16-bit index registers (as IXL, IXH, IYL and IYH respectively).