Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

Memory and input/output addressing of 8085 microprocessors.

Parmod Kumar
Section. F4901 Roll.No. RF4901B44 Regd.No.10900960 Class.B.Tech(ME) ACKNOWLEDGEMENT I take this opportunity to present my votes of thanks to all those guidepost who really acted as lightening pillars to enlighten our way throughout this project that has led to successful and satisfactory completion of this study. We are really grateful to our HOD for providing us with an opportunity to undertake this project in this university and providing us with all the facilities. We are highly thankful to our subject teacher Miss. Lipsa Das for her active support, valuable time and advice, whole-hearted guidance, sincere cooperation and painstaking involvement during the study and in completing the assignment of preparing the said project within the time stipulated. Lastly, We are thankful to all those, particularly the various friends , who have been instrumental in creating proper, healthy and conductive environment and including new and fresh innovative ideas for us during the project, their help, it would have been extremely difficult for us to prepare the project in a time bound framework. Microprocessor A microprocessor incorporates most or all of the functions of a computer's central processing unit (CPU) on a s

Affordable 8-bit microprocessors with 16-bit addressing also led to the first general purpose microcomputers from the mid-1970s on. During the 1960s, computer processors were often constructed out of small and medium-scale ICs containing from tens to a few hundred transistors. The integration of a whole CPU onto a single chip greatly reduced the cost of processing power. From these humble beginnings, continued increases in microprocessor capacity have rendered other forms of computers almost completely obsolete, with one or more microprocessors used in everything from the smallest embedded systems and handheld devices to the largest mainframes and supercomputers. Since the early 1970s, the increase in capacity of microprocessors has been a consequence of Moore's Law, which suggests that the number of transistors that can be fitted onto a chip doubles every two years. Although originally calculated as a doubling every year, Moore later refined the period to two years. In the late 1990s, and in the high-performance

single integrated circuit (IC, or microchip). The first microprocessors emerged in the early 1970s and were used for electronic calculators, arithmetic using binary-coded on 4-bit words.

microprocessor segment, heat generation (TDP), due to switching losses, static current leakage, and other factors, emerged as a leading developmental constraint.

decimal (BCD)

Other embedded uses of 4-bit and 8-bit microprocessors, such as terminals, printers, various kinds of automation etc.

The data to be processed by arithmetic and logic unit is stored in accumulator. 8085 Microprocessor The Intel 8085 is an 8-bit microprocessor introduced It also stores the result of the operation carried out by the Arithmetic and Logic unit. The accumulator is also called an 8-bit register. The accumulator is connected to Internal Data bus and ALU (arithmetic and logic unit). The accumulator can be used to send or receive data from the Internal Data bus. Arithmetic and Logic Unit There is always a need to perform arithmetic operations like +, -, *, / and to perform logical operations like AND, OR, NOT etc. So there is a necessity for creating a separate unit which can perform such types of operations. These operations are performed by the Arithmetic and Logic Unit (ALU). ALU performs these operations on 8-bit data. But these operations cannot be performed unless we have an input (or) data on which the desired operation is to be performed. So from where do these inputs reach the ALU? For this purpose accumulator is used. ALU gets its Input from accumulator and temporary register. After processing the necessary operations, the result is stored back in accumulator. General Purpose Registers Apart from accumulator 8085 consists of six special types of registers called General Purpose Registers. These general purpose registers are used to hold data like any other registers. The general purpose registers in 8085 processors are B, C, D, E, H and L. Each register can hold 8bit data. Apart from the above function these registers can also be used to work in pairs to hold 16-bit data. They can work in pairs such as B-C, D-E and H-L to store 16-bit data. The H-L pair works as a memory pointer. A memory pointer holds the address of a particular memory location. They can store 16-bit address as they work in pair.

by Intel in 1977. It was binary-compatible with the morefamous Intel 8080 but required less supporting hardware, thus allowing simpler and less

expensive microcomputer systems to be built. The "5" in the model number came from the fact that the 8085 required only a +5-volt (V) power supply rather than the +5V, -5V and +12V supplies the 8080 needed. The 8085 had a long life as a controller.

Internal Architecture of 8085 Microprocessor:-

Accumulator Accumulator is nothing but a register which can hold 8-bit data. Accumulator aids in storing two quantities.

Temporary Register: As the name suggests this register acts as a temporary memory during the arithmetic and logical operations. Unlike other registers, this temporary register can only be accessed by the microprocessor and it is completely inaccessible to programmers. Temporary register is an 8-bit register.

8085 Architecture Pin Diagram

Program Counter and Stack Pointer Program counter is a special purpose register. Consider that an instruction is being executed by processor. As soon as the ALU finished executing the instruction, the processor looks for the next instruction to be executed. So, there is a necessity for holding the address of the next instruction to be executed in order to save time. This is taken care by the program counter. A program counter stores the address of the next instruction to be executed. In other words the program counter keeps track of the memory address of the instructions that are being executed by the microprocessor and the memory address of the next instruction that is going to be executed. Microprocessor increments the program whenever an instruction is being executed, so that the program counter points to the memory address of the next instruction that is going to be executed. Program counter is a 16-bit register. Stack pointer is also a 16-bit register which is used as a memory pointer. A stack is nothing but the portion of RAM (Random access memory). So does that mean the stack pointer points to portion of RAM? Yes. Stack pointer maintains the address of the last byte that is entered into stack. Each time when the data is loaded into stack, Stack pointer gets decremented. Conversely it is incremented when data is retrieved from stack.

Address Bus: The pins A8-A15 denote the address bus. They are used for the most significant bit of memory address. Address/Data Bus: AD0-AD7 constitutes the Address/Data bus. They are time multiplexed. These pins are used for least significant bits of address bus in the first machine clock cycle and used as data bus for second and third clock cycle. But what is a clock cycle? What is first clock cycle and second, third so on...

A clock cycle is nothing but the time taken between two adjacent pulses of the oscillator. In simple words clock cycle refers to the transition between o volts to 5 volts and back to 0 volts. So the first clock cycle means the first transition of pulse from 0volts to 5 volts and then back to 0 volts. ALE: Address Latch Enable: In the previous article we saw how ALE helps in demultiplexing the lower order address and data bus. This signal goes high during the first clock cycle and enables the lower order address bits. The lower order address bus is added to memory or any external latch. IO/M: Consider we have an address to be processed. But how do the processors know whether the address is for memory or I/O functions? For this purpose a status signal called IO/M is used. This distinguishes whether the address is for memory or IO. When this pin goes high, the address is for an I/O device. While the pin goes low, the address is assigned for the memory. S0-S1: S0 and S1 are status signals which provides different status and functions depending on their status.

READY is used by the microprocessor to check whether a peripheral is ready to accept or transfer data. A peripheral may be a LCD display or analog to digital converter or any other. These peripherals are connected to microprocessor using the READY pin. If READY is high then the periphery is ready for data transfer. If not the microprocessor waits until READY goes high. HOLD: This indicates if any other device is requesting the use of address and data bus. Consider two peripheral devices. One is the LCD and the other Analog to Digital converter. Suppose if analog to digital converter is using the address and data bus and if LCD requests the use of address and data bus by giving HOLD signal, then the microprocessor transfers the control to the LCD as soon as the current cycle is over. After the LCD process is over, the control is transferred back to analog and digital converter. HLDA: HLDA is the acknowledgment signal for HOLD. It indicates whether the HOLD signal is received or not. After the execution of HOLD request, HLDA goes low. INTR: INTR is an interrupt request signal. It has the lowest priority among the interrupts. INTR can be enabled or disabled by using software. Whenever INTR goes high the microprocessor completes the current instruction which is being executed and then acknowledges the INTR signal and processes it. INTA: Whenever the microprocessor receives interrupt signal. It has to be acknowledged. This acknowledgement is done by INTA. So whenever the interrupt is received INTA goes high. RST 5.5, 6.5, 7.5: These are nothing but the restart interrupts. They insert an internal restart function automatically. All the above mentioned interrupts are maskable interrupts. That is, they can be enabled or disabled using programs. TRAP: Among the interrupts of 8085 microprocessor, TRAP is the only non-maskable interrupt. It cannot be enabled or disabled using a program. It has the highest priority among the interrupts.

RD: This is an active low signal. That is, an operation is performed when the signal goes low. This signal is used to control READ operation of the microprocessor. When this pin goes low the microprocessor reads the data from memory or I/O device. WR: WR is also an active low signal which controls the write operations of the microprocessor. When this pin goes low, the data is written to the memory or I/O device. READY:

PRIORITY ORDER (From highest to lowest) TRAP RST 7.5 RST 6.5 RST 5.5 INTR

SOD: This pin provides the serial output data. The serial data on this pin delivers its output to the seventh bit of the accumulator when SIM instruction is executed. Vcc and Vss: Vcc is +5v pin and Vss is ground pin. Thus the pin diagram and signals of 8085 microprocessor are explained in detail.

RESET IN: This pin resets the program counter to 0 and resets interrupt enable and HLDA flip-flops. The CPU is held in reset condition until this pin is high. However the flags and registers wont get affected except for instruction register. RESET OUT: This pin indicates that the CPU has been reset by RESET IN. X1 X2: These are the terminals which are connected to external oscillator to produce the necessary and suitable clock operation. CLK: Sometimes it is necessary for generating clock outputs from microprocessors so that they can be used for other peripherals or other digital ICs. This is provided by CLK pin. Its frequency is always same as the frequency at which the microprocessor operates. SID: This pin provides serial input data. The serial data on this pin is loaded into the seventh bit of the accumulator when RIM instruction is executed. RIM stands for READ INTERRUPT MASK, which checks whether the interrupt is masked or not.

Memory:Program, data and stack memories occupy the same memory space. The total addressable memory size is 64 kb. Program memory:- Program can be located anywhere in memory. Jump, branch and call instructions use 16-bit addresses, ie. they can be used to jump/branch anywhere within 64 KB. All jump/branch instructions use absolute addressing. Data memory:- The processor always uses 16-bit addresses so that data can be placed anywhere. Input/output scheme:The 8085 supported up to 256 input/output (I/O) ports, accessed via dedicated I/O instructionstaking port addresses as operands. This I/O mapping scheme was regarded as an advantage, as it freed up the processor's limited address space. Many CPU architectures instead use a common address space without the need for dedicated I/O instructions, although a drawback in such designs may be that special hardware must be used to insert wait states as peripherals are often slower than memory. However, in some simple 8080 computers, I/O was indeed addressed as if they were memory cells, "memory mapped", leaving the I/O commands unused. I/O addressing could also sometimes employ the fact that the processor would output the same 8bit port address to both the lower and the higher address byte (i.e. IN 05h would put the address 0505h on the 16-bit address bus). Similar I/O-port schemes are used in the 8080-

compatible Zilog Z80 as well as the closely related x86 families of microprocessors. The 8085 Addressing Modes:The instructions MOV B, A or MVIA, 82H are to copy data from a source into adestination. In these instructions the source can be a register, an input port, or an 8-bitnumber (00H to FFH). Similarly, a destination can be a register or an output port. Thesources and destination are operands. The various formats for specifying operands arecalled the ADDRESSING MODES. For 8085, they are: 1. Immediate addressing. 2. Register addressing. 3. Direct addressing. 4. Indirect addressing. Immediate addressing:Data is present in the instruction. Load the immediate data to the destination provided. Example: MVI R,data Register addressing Data is provided through the registers. Example: MOV Rd, Rs Direct addressing:Used to accept data from outside devices to store in the accumulator or send the data stored in the accumulator to the outside device. Accept the data from the port 00H and store them into the accumulator or Send the data from the accumulator to the port 01H. Example: IN 00H or OUT 01 Indirect Addressing:This means that the Effective Address is calculated by the processor. And the contents of the address (and the one following) is used to form a second address. The second address is where the data is stored. Note that this requires several memory accesses; two accesses to retrieve the 16-bit address and a further access (or accesses)to retrieve the data which is to be loaded into the register

Instruction Set Classification An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire group of instructions, called the instruction set, determines what functions the microprocessor can perform. These instructions can be classified into the following five functional categories: data transfer (copy) operations, arithmetic operations, logical operations, branching operations, and machine-control operations. Data Transfer Operations This group of instructions copy data from a location called a source to another location called a destination, without modifying the contents of the source. In technical manuals, the term data transfer is used for this copying function. However, the term transfer is misleading; it creates the impression that the contents of the source are destroyed when, in fact, the contents are retained without any modification. Arithmetic Operations These instructions perform arithmetic operations such as addition, subtraction, increment, and decrement. Addition - Any 8-bit number, or the contents of a register or the contents of a memory location can be added to the contents of the accumulator and the sum is stored in the accumulator. No two other 8-bit registers can be added directly (e.g., the contents of register B cannot be added directly to the contents of the register C). The instruction DAD is an exception; it adds 16-bit data directly in register pairs. Subtraction - Any 8-bit number, or the contents of a register, or the contents of a memory location can be subtracted from the contents of the accumulator and the results stored in the accumulator. The subtraction is performed in 2's compliment, and the results if negative, are expressed in 2's complement. No two other registers can be subtracted directly. Increment/Decrement - The 8-bit contents of a register or a memory location can be incremented or decrement by 1. Similarly, the 16-bit contents of a register pair (such as BC) can be incremented or decrement by 1. These increment and decrement operations differ from addition and subtraction in an important way i.e., they can be performed in any one of the registers or in a memory location. Logical Operations These instructions perform various logical operations with the contents of the accumulator. AND, OR Exclusive-OR -A memory location can be logically AND Or, or Exclusive-OR with the contents of the accumulator. The results are stored in the accumulator. Rotate-Each bit in the accumulator can be shifted either left or right to the next position.

Compare- Any 8-bitnumber, or the contents of a register, or a memory location can be compared for equality, greater than, or less than, with the contents of the accumulator. Complement - The contents of the accumulator can be complemented. All 0s are replaced by 1s and all 1s are replaced by 0s. Branching Operations This group of instructions alters the sequence of program execution either conditionally or unconditionally. Jump -Conditional jumps are an important aspect of the decision-making process in the programming. These instructions test for a certain conditions (e.g., Zero or Carry flag) and alter the program sequence when the condition is met. In addition, the instruction set includes an instruction called unconditional jump. Call, Return, and Restart - These instructions change the sequence of a program either by calling a subroutine or returning from a subroutine. The conditional Call and Return instructions also can test condition flags. .

Reference http://www.brighthub.com/engineering/electrical/articles/52 160.aspx http://www.cpu-world.com/Arch/8085.html http://www.scribd.com/doc/4616314/8085-Microprocessor http://www.indiastudychannel.com/resources/8209Introduction-to-Intel.aspx

You might also like