Intel 8085 Microprocessor Architecture
Total Page:16
File Type:pdf, Size:1020Kb
CHAPTER INTEL 8085 MICROPROCESSOR 2 ARCHITECTURE Learning Outcomes: After completion of this chapter, you will be able to understand the following: • Pin details and logic schematic of the 8085 microprocessor • Internal functional operation of 8085 microprocessor • Flag register and the purpose of each flag bit. • Purpose of registers, accumulators and the system bus used in 8085 microprocessor. 1.1 INTRODUCTION instruction available at 8800H, it goes to the next address 8801H (assuming single byte instructions) and so on, until The microprocessor is a semiconductor device consisting it reaches the end of the program. of electronic logic circuits manufactured by using either a Intel 8085 is an eight bit microprocessor of INTEL large-scale integration (LSI) or very-large-scale integration Corporation, usually called as a general purpose 8-bit (VLSI) technique. Any microprocessor basically contains Processor. It is upward compatible with microprocessor registers, Arithmetic unit, logic unit, flip-flops and timing 8080, which was the earlier product of INTEL. There are and control circuits. All the microprocessors work using several faster versions of 8085 microprocessor such as Von Neumann Architecture. In this architectural working 8085AH, 8085AH-1, 8085AH-2 etc. of a microprocessor, the CPU or the processor fetches A microcomputer consists of three functional blocks instructions from the memory, decodes it (interprets the viz., a Central Processing Unit (CPU), input/output, and nature of instruction/command and develops clock by clock memory units as shown in Fig.2.1. The CPU contains steps for execution), generates appropriate control signals several registers, an Arithmetic and Logic unit (ALU), and a and finally the instruction is executed. The program is stored Control unit. The function of ALU is to perform operations consecutively in the memory locations. The execution steps related to arithmetic and logical operations. The Control are repeated for all the instructions of the program until the unit translates the instructions and executes the desired task. last instruction. The data required may either be taken from memory or from input ports and the results of the program will be stored in the memory or given out through output ports. 1.2 ARCHITECTURE OF 8085 A program is a list of instructions for the microprocessor The block diagram explaining the architecture of Intel 8085 to carry out. Before the start of execution, the complete Microprocessor is shown in Fig.2.2. It is available generally program must be stored in the memory. Let us assume as a 40 pin IC package and uses +5V for power. It can run at that the starting address of the stored program is 8800H. a maximum frequency of 3 MHz. The modified versions of While running the program the microprocessor must be the 8085 processor have these minimum common features directed to ‘go’ from 8800H. Once it has completed the and functional similarities. Demy_Quarto_Sample.indd 1 12/8/2013 7:38:22 PM 2 INTEL 8085 MICROPROCESSOR ARCHITECTURE Memory memory (1 K byte = 1024 byte). The processing unit or the processor consists of five functional units: ROM (Read Only Memory) (i) Arithmetic and logic Unit (ii) General purpose registers RAM (iii) Special Purpose Registers (Random Access Memory) (iv) Instruction register and decoder and, (v) Timing and control unit. 2.2.1 Arithmetic Logic Unit (ALU) ALU is the circuitry which performs the actual numerical Processor and logical operations. Addition (ADD), subtraction (SUB), Control increment (INR), decrement (DCR) and comparison (CMP) Unit Input Output are the arithmetic operations available in 8085 microprocessor. Unit Unit The possible logical operations in 8085 are AND (AND), OR ALU (OR), EXCLUSIVE OR (XOR), COMPLEMENT (CMA) etc. While the data is drawn from the memory, the operation FIG. 2.1 A microprocessor system executed with the content of the accumulator and the results stored in the Accumulator. ALU of 8085 is called accumulator 8085 is called as an 8-bit processor since its data length is oriented ALU as the one of the data for arithmetic and logic 8-bit and has a data bus of 8-bits wide. It has an addressing operations must be stored in accumulator. If the operation needs capability of 16-bit. i.e., it can address 216 = 64 K bytes of only one data, then that data must be stored in accumulator. INTA RST 6.5 TRAP INTR RST 5.5 RST 7.5 SID SOD Interrupt Control Serial I/O Control 8-Bit Internal Data Bus Accumulator Temp. Reg. Instruction Multiplexer (8) (8) Register (8) W (8) Z (8) Temp. Reg. Temp. Reg. Flag (5) B (8) C (8) Flip-Flops Reg. Reg. t D (8) E (8) Instruction Reg. Reg. Decoder Arithmetic and H (8) L (8) Register Logic Machine Selec Reg. Reg. Reg. Array Unit Cycle (16) (ALU) Encoding (8) Stack Pointer (16) Program Counter Incrementer/Decrementer + 5 V Power Supply Address Latch (16) GND Timing and Control X1 CLK Reset Address Buffer (8) Data/Address Buffer (8) X2 GEN Control Status DMA CLK OUT RD WR ALE S0 S1 IO/M HLDA RESET OUT A −A AD −AD READY HOLD RESET IN 15 8 7 0 Address Bus Address/Data Bus FIG 2.2 Functional Block of Intel 8085 Demy_Quarto_Sample.indd 2 12/8/2013 7:38:23 PM INTEL 8085 MICROPROCESSOR ARCHITECTURE 3 register. It is used to store 8-bit data and serves to perform ACCUMULATOR A (8) FLAG REGISTER arithmetic and logical operations. The result of an operation B (8) C (8) is also stored in the accumulator. The accumulator is identified as register A in the instruction set of 8085. The D (8) E (8) programmer can use it at any time to store an 8-bit binary H (8) L (8) number. Being only an 8-bit register, it can only hold one byte at a time. Any previous data stored in this register will Stack Pointer (SP) (16) be overwritten as soon as new data is stored. Also the 8085 microprocessor communicates with input/output devices Program Counter (PC) (16) only through A. Data Bus Address Bus 2.2.3.2 The flag register 8 Lines Bidirectional 16 Lines unidirectional This is a special 8-bit register. Each bit of flag register is quite independent of each other. In all other registers, each FIG 2.3 Registers of Intel 8085 bit is just part of a single binary byte value and hence each bit would have a numerical value. The flag is an 8-bit register used to indicate the status of the recent arithmetic 2.2.2 The general-purpose registers or logic operation. It may be set or reset after an arithmetic A register is a collection of 8 D type flip-flops with parallel or logical operation according to the condition of the in and parallel out operation. A flip-flop can only store one processed data. The five flag bits are Zero (Z), Carry (CY), bit at a time. Therefore to handle 8 bits at a time, 8 flip-flops Sign (S), Parity (P), and Auxiliary Carry (AC) flags and are required and hence the term 8-bit register. Though the their bit positions in the flag register are shown in Figure registers are also storage areas inside the microprocessor, 2.4. The remaining three bits (D1, D3 and D5) of the flag they differ by the purpose of storage. The general purpose register remain unassigned and they are marked with an X registers are used to store only the data that is used by the to show that they are not used and are don’t cares. currently running program or the results obtained from the Any flag register bit is said to be ‘set’ when its value is currently running program. These general purpose registers 1 and is said to be ‘cleared’ when its value is 0. The most are user accessible by programs. commonly used flags are Zero, Carry, and Sign. AC flags Registers B, C, D, E, H and L are the general purpose can not be accessed externally. registers of 8085 as shown in figure 2.3. They can also be called as Scratch Pad registers. Almost in all arithmetic and logic operations these registers are used as the second XXX operands while the first operand being the accumulator D7 D6 D5 D4 D3 D2 D1 D0 (A). The general-purpose registers are all 8-bit registers but they can be handled as 16-bit registers as well. This can be S Z AC P CY achieved by combining the register pairs as B and C, D and E, FIG. 2.4 Flag register and H and L — to perform 16-bit operations. They are named respectively as register pairs BC, DE, and HL respectively. Sign flag (S) The S flag is just a copy of the bit D7 Among these pairs, HL has a special significance. A few (Most Significant Bit-MSB) of the accumulator. A negative memory related instructions of 8085 (refer instruction set) use number has a 1 in bit 7 and a positive number has a 0 in bit the HL pair as a memory pointer. For example, the instruction 7. So this flag indicates the sign of the number. It may be “MOV A, M” transfers the content of memory location recalled that signed magnitude numbers use a 1 to indicate pointed by the HL pair to accumulator. The HL pair is pre- a negative number and 0 to indicate a positive number. This loaded with the memory address in which data is available. flag can be used in signed arithmetic operations. 2.2.3 The special -purpose registers Zero flag (Z) The zero flag is set if an arithmetic operation results in a zero.