proj-plbook-plChZ80Isa

Table of Contents for Programming Languages: a survey

Zilog Z80

"The Zilog Z80 was a software-compatible extension and enhancement of the Intel 8080"

Registers

8080 registers:

"

The new registers introduced with the Z80 are:

" There is no direct access to the alternate registers; instead, two special instructions, EX AF,AF' and EXX,[32] each toggles one of two multiplexer flip-flops. This enables fast context switches for interrupt service routines: EX AF, AF' may be used alone, for really simple and fast interrupt routines, or together with EXX to swap the whole BC, DE, HL set. This is still several times as fast as pushing the same registers on the stack. Slower, lower priority, or multi level interrupts normally use the stack to store registers, however. "

"No multiply instruction is available in the original Z80."

[1]

"

Comparison with the 6502 and 8085

While the Z80's register complement is tiny compared to current processors, it has a solid register set by 1976 standards - about twice as many registers as the 8085 and about four times as many registers as the 6502. Because they share the 8080 heritage, many of the 8085's registers are similar to the Z80, but the Z80 adds the IX and IY index registers, as well as the second set of registers. ... The register file consists of 14 pairs of 8-bit registers. In many cases, a pair of 8-bit registers is treated as a single 16-bit register. ... 8-bit accumulator (A) and 8-bit flag register (F). The accumulator holds the result of arithmetic and logic operations, so it is a very important register. The flag register holds condition flags, for instance indicating a zero value, negative value, overflow value or other conditions.

Note that there are two A registers and two F registers, along with two of BC, DE, and HL. The Z80 is described as having a main register set (AF, BC, DE, and HL) and an alternate register set (A'F', B'C', D'E', and H'L') ... two general-purpose BC registers. These can be used as 8-bit registers (B or C), or a 16-bit register (BC). Next to them are the similar DE and HL registers. The HL register is often used to reference a location in memory; H holds the high byte of the address, and L holds the low byte. This register structure is based on the earlier 8080 microprocessor. ... 16-bit IX and IY index registers. These are used to point to the start of a region in memory, such as a table of data ... 16-bit stack pointer SP...The stack pointer indicates the top of the stack in memory. Data is pushed and popped from the stack, for instance in subroutine calls. ... The Z80 includes a WZ register pair for temporary storage that isn't visible to the programmer...The primary use of WZ is to hold an operand from a two or three byte instruction until it can be used... ... The Z80's register storage has many similarities to the 8085, both in the registers provided and their hardware implementation, but is very different from the 6502. "

Links

http://www.z80.info/z80-op.txt

http://www.z80.info/

http://www.z80.info/#BASICS_INST

http://en.wikipedia.org/wiki/Zilog_Z80

http://z80.info/zip/z80cpu_um.pdf

http://clrhome.org/table/

Zilog's Z80 CPU user manual

Programming the Z80 by Rodnay Zaks (HTML), (PDF)

tjmerritt's Z80 emulator