6.1 THE Z80 PROGRAMMING MODEL In Chapter 2, we developed a model to represent the internal structure of the MPU shown in Figure 2.3. We will now describe a similar model of the Z80 microprocessor; however, we will include only those components necessary for the programmer. Figure 6.1 shows such a model, which includes an […]
Continue reading…
Posts by Farahat
Introduction to Z80 Assembly Language Programming
Introduction to Z80 Assembly Language Programming An assembly language program is a set of instructions, written in the mnemonics of a given microprocessor, and in a sequence appropriate to a specified task. To write such programs, we should be familiar with the programming model (internal registers) of the microprocessor and its instruction set. This chapter […]
Continue reading…
introduction to assembly language programming of z80
is an introduction to Z80 assembly language programming. It explains commonly used instructions, elementary programming techniques and their applications, and the modular approach to software design. The content is presented in a format similar to one for learning a foreign language. One approach to learning a foreign language is to begin with a few words […]
Continue reading…
ASSIGNMENTS ON INTERFACING I/O DEVICES
ASSIGNMENTS 1. Explain why the number of output ports in peripheral-mapped I/O is restricted to 256 ports. 2. In peripheral-mapped I/O, can an input port and an output port have the same port address? 3. If an output and input port can have the same 8-bit address, how does the Z80 differentiate between the ports? […]
Continue reading…
SUMMARY OF INTERFACING I/O DEVICES
SUMMARY in this chapter, we have examined the machine cycles of the OUT and IN instructions and derived the basic concepts for interfacing peripheral-mapped I/Os. Similarly, we examined the machine cycles of memory-related data transfer instructions and derived the basic concepts for interfacing memory-mapped I/Os. These concepts were illustrated with three examples of interfacing I/O […]
Continue reading…
5.9 SOME QUESTIONS AND ANSWERS
5.9 SOME QUESTIONS AND ANSWERS During the discussion of interfacing I/O devices, we focused on the basic concepts and avoided some details in order to simplify the presentation. We will now attempt to answer some of those questions. 1. What are the other I/O instructions in the Z80 instruction set, and how do they differ […]
Continue reading…
5.8 TROUBLESHOOTING I/O INTERFACING CIRCUITS
5.8 TROUBLESHOOTING I/O INTERFACING CIRCUITS In the last several sections, we discussed the interfacing of I/O devices and instructions to test them. In I11ustrative Example 1(Figure 5.4), the test program includes two instructions that load the byte 97H into the accumulator and output the byte to port 07H• If we execute these instructions and no […]
Continue reading…
5.7 ADDITIONAL ILLUSTRATIVE EXAMPLES: INTERFACING SENSORS AND MOTORS
5.7 ADDITIONAL ILLUSTRATIVE EXAMPLES: INTERFACING SENSORS AND MOTORS In previous examples, we illustrated the interfacing of I/O devices that were primarily binary devices (on/off). We now extend the concepts to interface analog devices such as temperature sensors and motors. In interfacing analog devices, the basic procedure remains similar to that of interfacing binary devices; the […]
Continue reading…
ILLUSTRATIVE EXAMPLE 3: APPLIANCE CONTROL USING MEMORY-MAPPED I/O TECHNIQUE
ILLUSTRATIVE EXAMPLE 3: APPLIANCE CONTROL USING MEMORY-MAPPED I/O TECHNIQUE Figure 5.10 shows a schematic of interfacing I/O devices using the memory mapped I/O technique. The circuit includes one input port with eight DIP switches and one output port to control the appliances. The appliances are turned on and off by the microprocessor according to the […]
Continue reading…
5.5 MEMORY-MAPPED I/O
5.5 MEMORY-MAPPED I/O In, memory-mapped I/O, the input and output devices are assigned and identified by 16-bit addresses. To transfer data between the microprocessor and I/O devices, memory- related instructions (such as LD A, (16-bit) and memory control signals (such as M̅R̅E̅Q̅) are used. The microprocessor communicates with an I/O device as if it were […]
Continue reading…