Z80 INSTRUCTIONS RELATED TO INDEX REGISTERS The Z80 microprocessor includes two 16-bit index registers IX and IY, and they are used primarily as memory pointers. In the previous sections, we discussed instructions concerning data copy, arithmetic, and branch operations. The Z80 can perform these operations with the contents of memory registers using the index […]
Continue reading…
Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES
Relative Jump Instructions
Relative Jump Instructions The Z80 instruction set includes two types of relative Jump instructions: unconditional and conditional. The new address to which the program sequence is redirected is specified by an 8-bit offset (displacement) value relative to the Jump instruction. The displacement can be positive (forward jump), specified by the seven bits D6-D0 (the MSB […]
Continue reading…
BRANCH OPERATIONS
BRANCH OPERATIONS The branch instructions and their associated flags are the key to the power of a computer or its microprocessor. These instructions can change the sequence of execution based on certain data conditions indicated by the flags; thus, they are decision-making instructions. The branch instructions are classified into three categories, as listed in Chapter […]
Continue reading…
Flags and Decision Making
Flags and Decision Making As described in Chapter 6, the Z80 architecture includes six flags, which are flip-flops that are set or reset after the execution of arithmetic and logic operations, with some exceptions. Four of the flags (S, Z, P/V, and CY) can be used by the programmer for decision making in conjunction with […]
Continue reading…
ARITHMETIC OPERATIONS
ARITHMETIC OPERATIONS The Z80 microprocessor performs various arithmetic operations such as addition, subtraction, increment/decrement, and I’s and 2’s complement. Most of these operations are concerned, with 8-bit operands. The instruction set also includes some 16-bit operations that will be discussed in later chapters. (See Appendix A for a complete alphabetical listing of the Z80 instruction […]
Continue reading…
Data Copy Between Accumulator and I/Os
Data Copy Between Accumulator and I/Os In the Z80 instruction set, input and output devices are identified by 8-bit addresses, The set includes several instructions that can read data from an in put device (also known as input port) and write data into an output device (or output port). Two of these I/O instructions are […]
Continue reading…
DATA COPY (LOAD) OPERATIONS
DATA COPY (LOAD) OPERATIONS In this section, we focus on three types of data copy operations: data copy related to microprocessor registers, memory, and I/Os. Instructions frequently used are illustrated below, and the Z80 block transfer instruction will be discussed later in the chapter. In addition, one machine control instructionــــHALTــــis introduced; this instruction is necessary […]
Continue reading…
Introduction to Z80 Instructions and Programming Techniques
Introduction to Z80 Instructions and Programming Techniques When a microcomputer is asked to execute a program stored in its memory, it reads one instruction at a time and performs the task specified by the instruction. Each instruction in the program is a command, in binary, to the microprocessor to perform an operation. In […]
Continue reading…