Professional Documents
Culture Documents
8085
8085
8085
INTEL 8085 is an 8-bit microprocessor. The data word size of the 8085 microprocessor is 8-bits. Hence has 8-bit data bus. The address size of 8085 microprocessor is 16-bits. Hence uses 16-bit address bus. It can directly process on 8-bits of data in single operation, hence it is known to be an 8-bit microprocessor. It can directly address 216 = 65,536 bytes i.e., 64 Kbytes (64 K memory locations) using 16-bits of address. 8085 microprocessor is fabricated using NMOS technology and comes in an 40-pin DIP(dual-in-line) package.
INTEL 8085-Features
It requires a single power supply of +5V. It has provision of internal frequency generation when an crystal is connected between the specified pins. The generated clock is divided by a factor of 2, hence to operate an 8085 based system at an frequency of 3 MHz, an crystal of 6 MHz frequency need to be connected to 8085. The NMOS 8085 is available in two versions 8085A and 8085A-2 with maximum internal clock frequency of 3.03 MHz and 5 MHz respectively and hence require an crystal of 6.06 MHz and 10 MHz to be connected them respectively.
INTEL 8085-Features
The enhanced version of 8085 is designed with HMOS transistors. It is available in three versions 8085AH, 8085AH-2, 8085AH-1 with maximum internal clock of 3 MHz, 5 MHz and 6 MHz respectively. The clock cycle of 8085 is of order of 320 ns and that for 8085AH-2 version is 200 ns. It has 80 basic instructions and 246 opcodes. 8085 is enhanced version of its predecessor the 8080A microprocessor; thus its instruction set is upward compatible with that of 8080A, i.e., 8085 instruction set includes all the 8080A instructions plus some more instructions.
INTEL 8085-Features
Thus the programs written for the 8080A will be executed by the 8085 microprocessor. But 8085 and 8080A are not pin compatible, i.e., the 8085 microprocessor can not be used in place of 8080A microprocessor in an 8080A based system.
INTEL 8085-Architecture
The internal block diagram of 8085 microprocessor consists of the following main sections: An arithmetic and logic unit
A timing and control unit
A set of registers
Interrupt Signals
. . .
Interrupt Control
SID SOD
Accumulator
Temporary Register
Status Flags
B D H
C E L
Program Counter(PC)
Address Buffer
X1
X2
ALU
The arithmetic and logical unit(ALU), performs the following arithmetic and logical operations: Addition Subtraction Logical AND Logical OR Logical Exclusive-OR Complement (Logical NOT) Increment (add 1) Decrement(Subtract 1) Left shift, Right shift, Rotate Left,Rotate right Clear e.t.c.
Registers
Registers are used by the microprocessor for temporary storage and manipulation of data and instructions. Data remains in the register till they are sent to the memory or I/O devices. INTEL 8085 microprocessor has the following registers:
One 8-bit accumulator (ACC) i.e., Register-A Six 8-bit general purpose registers. These are B,C,D,E,H and L. One 16-bit stack pointer (SP) One 16-bit program counter (PC) Instruction register Temporary register Incrementer/Decrementer Flag register ( a register made up of individual flip-flops out of which only five are active.
Registers
Accumulator:
Accumulator is an 8-bit register associated with the ALU. It is used to hold one of the operands of an arithmetic or logical operation, the other operand is held in either one of the general purpose registers or in memory. After the operation is completed the accumulator holds the final result.
Registers
General Purpose Registers: six 8-bit general purpose registers are present in 8085. The general purpose registers present in 8085 microprocessor are: B,C,D,E,H and L. To hold 16-bit data a combination of two 8-bit registers can be used and are known as register pair. The valid register pairs in 8085 are: B-C,D-E and H-L. H-L pair can be used as an memory pointer to access the 16-bit address of an memory location indirectly. The general purpose registers and accumulator are programmer accessible. BC, DE and HL registers are known as scratch pad registers. Basically this register array is like a small chip of RAM with addressable memory locations. By using proper control signals,the CPU can either load a register from the internal data bus or the output of these registers to the bus.
Registers
Program Counter (PC):
It is a 16-bit special purpose register. It is used to hold the memory address of the next instruction to be executed. It keeps the track of memory address of the instructions in a program while they are being executed. The microprocessor increments the contents of the program counter during the execution of an instruction so that it points to the address of the next instruction in the program at the end of the execution of an instruction. It is not programmer accessible.
Registers
Stack Pointer (SP): It is a 16-bit special function register. The stack pointer holds the address of the top of the stack i.e., the top most element of data stored in stack and controls the addressing of the stack of 8085. The stack is a sequence of memory locations set aside by a programmer to store/retrieve the contents of internal registers of microprocessor such as accumulator,flags,program counter and general purpose registers during the execution of the program. Any portion of the memory can be used as stack. Stack works on FIFO(first-in-first-out) principle. Generally the stack operations of storing/retrieving should be faster compared to normal store/retrieve operations of memory locations.
Registers
During the execution of a program some times it becomes necessary to save the contents of the registers which are needed for some other operations in the subsequent steps of the program. The contents of such registers is saved in stack. After saving the contents in the stack the registers can be used for some other operations. After completing the needed operations the contents which were saved in the stack are brought back to the registers. The contents of only those registers which are needed in the later part of the program. The order of the storing into stack should be followed by the retrieving principle of the element stored last will be retrieved first and vice versa. The stack is defined and stack pointer is initialized by the programmer at the beginning of a program which needs stack operation and then updated due to either stack instructions in the program or by the microprocessor while executing some of the instructions like CALL.
Registers
Instruction Register / Decoder :
The instruction register holds the opcode (operation code or instruction code) of the instruction which is being decoded and executed. The decoder interprets the instruction and produces the proper signals to carry it out. It is not programmer accessible.
Temporary Register:
It is an 8-bit register associated with the ALU. It holds data during an arithmetic/logical operation. It is used by the microprocessor. It is not accessible to programmer.
Registers
Incrementer / Decrementer: The Incrementer / Decrementer allows the contents of any of the 16-bit registers to be incremented or decremented, by 1. Program Status Word: The five bits of the flag register which provide the information about the status of the instruction execution along with the three undefined bits is known as PSW (program status word). Thus the program status word is the flag register of the microprocessor.
Flag Register
The flag register of 8085 microprocessor 7 6 5 4 3 2 1 S Z X AC X P X 0 CY
The INTEL 8085 microprocessor contains five flip-flops to serve the status of the program/instruction execution as status flags. The flipflops are set or reset according to the conditions which arise during an arithmetic or logical operation. The five status flags of INTEL 8085 are : 1. Carry Flag (CY) 2. Parity Flag (P) 3. Auxiliary Carry Flag (AC) 4. Zero Flag (Z) 5. Sign Flag (S)
Flag Register
If a flip-flop for a particular flag is set, it indicates 1. When it resets it indicates 0.
Carry Flag (CY): After the execution of an arithmetic instruction if a carry is produced, the carry flag CY is set to 1, otherwise it is 0. The carry flag is set or reset in case of addition as well as subtraction. After the addition of 2 8-bit numbers is performed if the result is greater than 8-bits, a carry is produced, and the carry flag is set to 1. In case of subtraction, if the borrow occurs, the carry flag is set to 1. Thus carry flag holds the carry out of the most significant bit position resulting from the execution of an arithmetic operation.
Flag Register
Parity Flag (P): The parity status flag P is set to 1, if the result of an arithmetic or logical operation contains even number of 1s. It is reset i.e., it is 0, if the result contains odd number of 1s Auxiliary Carry Flag (AC): The Auxiliary Carry flag (AC) holds carry out of the lower most nibble to the next nibble i.e., from bit position 3 to the bit position 4 resulting from the execution of an arithmetic operation. Zero Flag (Z): The Zero status flag (Z) is set to 1, if the result of an arithmetic or logical operation is 0.If the result is not zero,the flag is reset i.e, set to 0.
Flag Register
Sign Flag (S): The Sign flag S is set to 1, if the result of an arithmetic or logical operation executed is negative. If the result is positive it is reset i.e., set to 0. The sign flag has its significance only when signed arithmetic operation is performed. To represent a signed number the most significant bit is reserved by the programmer to represent the sign of a number i.e., the MSB is used as a sign bit which represents the sign of the number, if the number is negative the sign bit is 1 and if the number is positive the sign bit is 0. For an 8-bit signed number only 7-bits are used to represent the magnitude of the number.
Flag Register
Sign Flag (S): After the execution of signed arithmetic operation, the MSB of the result represents its sign.The sign flag acquires the value of the MSB of the result following the execution of the signed arithmetic operation. Hence, it represents the sign of the result. For unsigned arithmetic operations, all the 8-bits are used to represent the magnitude of the number. After the execution of an arithmetic operation, all the 8-bits of the result represents its magnitude. Thus the sign flag has no significance in unsigned arithmetic operations. For logical operations also the sign bit has no significance, as the sign flag is set or reset depending on the value of the MSB of the result, it is set or reset on the value of MSB of the result of logical operations also.
Flag Register
Sign Flag (S): The sign flag is affected in the similar way for an signed arithmetic operation of 16-bit, 32-bit or more. In case of 16-bit operation 15-bits are used for representing the magnitude of the number and the 16th bit is used for representing the sign of the number. similarly in case of 32-bit number 31-bits are used for representing the magnitude and 1-bit is used for representing the sign of the number.
Flag Register
Effect on the flag register for example of CB + E9 CB = 1 1 0 0 1 0 1 1 E9 = 1 1 1 0 1 0 0 1 1 -------------------10110100 There is a carry from bit position 3 to bit position 4 thus AC = 1(set) There is a carry from bit position 7 to bit position 8 thus CY = 1(set) There is a non zero result thus Z = 0 There are even number of 1s thus P = 1 MSB = 1 thus S = 1.
SOD SOE
Serial Output Data
SOD Enable
A8 A15
CLK OUT HOLD
S0
S1 __ RD ___ WR ALE SID SOD READY
INTEL 8085
HLDA
TRAP RST 7.5 RST 6.5 RST 5.5 INTR ____ INTA