ASSIGNMENTS on INTRODUCTION TO Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES (part2)

ASSIGNMENTS on INTRODUCTION TO Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES (part2) 25. Rewrite the instructions in Figures 8.2 (a), (b), and (c) using the index regis­ters IX and IY as memory pointers. 26. Write instructions to load XX70H into the IY index register. Using the regis­ter IY as a memory pointer with appropriate offsets, store the […]
Continue reading…

 

ASSIGNMENTS on INTRODUCTION TO Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES( part 1)

ASSIGNMENTS on INTRODUCTION TO Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES Note: In the following assignments, substitute high-order memory address XX with the high-order address and PORT with the output port address of your single-board microcomputer system, Use your own data if data are not given, and specify memory addresses for labels such as INBUF and OUTBUF. […]
Continue reading…

 

SUMMARY off INTRODUCTION TO Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES

SUMMARY off INTRODUCTION TO Z80 INSTRUCTIONS AND PROGRAMMING TECHNIQUES   In this chapter, we illustrated a group of instructions from the Z80 set frequently used in writing programs. Instructions were selected from three groups: data copy, arithmetic, and branch. These instructions range from 1 byte to 4 bytes long. General characteristics of these instructions are […]
Continue reading…

 

ILLUSTRATIVE PROGRAM 3: BLOCK TRANSFER OF DATA BYTES USING Z80 SPECIAL INSTRUCTIONS

ILLUSTRATIVE PROGRAM 3: BLOCK TRANSFER OF DATA BYTES USING Z80 SPECIAL INSTRUCTIONS   This program transfers data from one memory block to another using the Z80 instruction LDIR. Problem Statement Modify the illustrative program (Section 8.6.3) using the instruction LDIR with the problem statement as follows: Transfer 1024 (1K) bytes from the memory block SOURCE […]
Continue reading…

 

Z80 SPECIAL INSTRUCTIONS

Z80 SPECIAL INSTRUCTIONS The Z80 instruction set includes some instructions that perform more than one task. These instructions improve programming efficiency considerably. Some of these instructions are: Mnemonics Description DJNZ d Decrement B and Jump Relative on no zero (Z = 0) The instruction decrements register B, and if B # 0, it jumps to […]
Continue reading…

 

Data Copy Between Z80 Registers and Memory

Data Copy Between Z80 Registers and Memory To copy data from and into memory, the 16-bit address of a selected memory register must be specified, and this memory address can be specified by using indirect, direct, or other addressing modes in the indirect addressing mode, the address of a memory location is loaded into the […]
Continue reading…

 

ILLUSTRATIVE PROGRAM 2: ADDITION WITH CARRY

ILLUSTRATIVE PROGRAM 2: ADDITION WITH CARRY The following program adds the number of bytes stored in memory and counts the number of carries generated. The maximum sum can be up to 16-bit. Problem Statement Add the following ten data bytes stored in memory with the starting address INBUF (Input Buffer). Store the sum in two […]
Continue reading…

 

ILLUSTRATIVE PROGRAM 1: BLOCK TRANSFEER OF DATA BYTES

ILLUSTRATIVE PROGRAM 1: BLOCK TRANSFEER OF DATA BYTES In practical applications, data transfer from one memory block to another is a com­mon occurrence. This illustrative program demonstrates how to copy data bytes from one block of memory to another using the instructions discussed previously. Problem Statement Ten bytes of data are stored in a block […]
Continue reading…

 

PROGRAMMING TECHNIQUES: LOOPING. COUNTING, AND INDEXJHG

PROGRAMMING TECHNIQUES: LOOPING. COUNTING, AND INDEXJHG The examples illustrated in the previous sections are simple and can be solved manually. However, a computer is at its best, surpassing human capability, when it has to repeat such tasks as adding a large set of numbers or copying bytes from one block of memory locations to another. […]
Continue reading…