0% found this document useful (0 votes)
19 views

Chapter 1

Microprocessor 8085 description

Uploaded by

ZAIEEM KHAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Chapter 1

Microprocessor 8085 description

Uploaded by

ZAIEEM KHAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Basics

A Microprocessor is an important part of a computer architecture without which


you will not be able to perform anything on your computer. It is a programmable
device that takes in input performs some arithmetic and logical operations over
it and produces the desired output. In simple words, a Microprocessor is a
digital device on a chip that can fetch instructions from memory, decode and
execute them, and give results.
1. Basics of Microprocessor –
2. A Microprocessor takes a bunch of instructions in machine language and
executes them, telling the processor what it has to do. The microprocessor
performs three basic things while executing the instruction:
3. It performs some basic operations like addition, subtraction, multiplication,
division, and some logical operations using its Arithmetic and Logical Unit
(ALU). New Microprocessors also perform operations on floating-point numbers
also.
4. Data in microprocessors can move from one location to another.
5. It has a Program Counter (PC) register that stores the address of the next
instruction based on the value of the PC, Microprocessor jumps from one
location to another and takes decisions.
6. A typical Microprocessor structure looks like this.

7. Clock Speed of different Microprocessors:


8. 16-bit Microprocessor –
9. 8086: 4.7MHz, 8MHz, 10MHz
10. 8088: more than 5MHz
11. 80186/80188: 6MHz
12. 80286: 8MHz
32-bit Microprocessor –
13. INTEL 80386: 16MHz to 33MHz
14. INTEL 80486: 16MHz to 100MHz
15. PENTIUM: 66MHz
64-bit Microprocessor –
16. INTEL CORE-2: 1.2GHz to 3GHz
17. INTEL i7: 66GHz to 3.33GHz
18. INTEL i5: 2.4GHz to 3.6GHz
19. INTEL i3: 2.93GHz to 3.33GHz
We do not have any 128-bit Microprocessor at work at present one of the reasons
for this is that we are a long way from exhausting the 64-bit address space itself, we
use it at a constant rate of roughly 2 bits every 3 years. At present we have only
used 48 bits of 64 bits so why require 128-bit address space. Also, 128-bit
Microprocessor would be much slower than the 64 bit Microprocessor.
Types of Processors:
Complex Instruction Set Computer (CISC) –
CISC or Complex Instruction Set Computer is a computer architecture where
instructions are such that a single instruction can execute multiple low-level operations
like loading from memory, storing into memory, or an arithmetic operation, etc. It has
multiple addressing nodes within a single instruction’s makes use of very few registers.
Example: Intel 386 , Intel 486,Pentium, Pentium Pro
Reduced Instruction Set Computer (RISC) –
RISC or Reduced Instruction Set Computer is a computer architecture where instruction
is simple and designed to get executed quickly. Instructions get completed in one clock
cycle this is because of the optimization of instructions and pipelining (a technique that
allows for simultaneous execution of parts, or stages, of instructions more efficiently
process instructions). RISC makes use of multiple registers to avoid large interactions
with memory. It has few addressing nodes. Example: IBM RS6000,MC88100, DEC
Alpha 21064
Explicitly Parallel Instruction Computing (EPIC) –
EPIC or Explicitly Parallel Instruction Computing permits computers to execute
instructions parallel using compilers. It allows complex instructions execution without
using higher clock frequencies. EPIC encodes its instruction into 128-bit bundles. each
bundle contains three instructions which are encoded in 41 bits each and a 5-bit
template field(contains information about types of instructions in a bundle and which
instructions can be executed in parallel). Example: IA-64 (Intel Architecture-6)

8085 Architecture
The 8085 microprocessor is an 8-bit microprocessor that was developed by Intel in the mid-1970s.
It was widely used in the early days of personal computing and was a popular choice for hobbyists
and enthusiasts due to its simplicity and ease of use. The architecture of the 8085 microprocessor
consists of several key components, including the accumulator, registers, program counter, stack
pointer, instruction register, flags register, data bus, address bus, and control bus.
The accumulator is an 8-bit register that is used to store arithmetic and logical results. It is the most
used register in the 8085 microprocessor and is used to perform arithmetic and logical operations such
as addition, subtraction, and bitwise operations.
1. The 8085 microprocessor has six general-purpose registers, including B, C, D, E, H, and L,
which can be combined to form 16-bit register pairs. The B and C registers can be combined
to form the BC register pair, the D and E registers can be combined to form the DE register
pair, and the H and L registers can be combined to form the HL register pair. These register
pairs are commonly used to store memory addresses and other data. The program counter is a
16-bit register that contains the memory address of the next instruction to be executed. The
program counter is incremented after each instruction is executed, which allows the
microprocessor to execute instructions in sequence. The stack pointer is a 16-bit register that
is used to manage the stack. The stack is a section of memory that is used to store data
temporarily, such as subroutine addresses and other data. The stack pointer is used to keep
track of the top of the stack. The instruction register is an 8-bit register that contains the
current instruction being executed. The instruction register is used by the microprocessor to
decode and execute instructions.
2. The flags register is an 8-bit register that contains status flags that indicate the result of an
arithmetic or logical operation. These flags include the carry flag, zero flag, sign flag, and
parity flag. The carry flag is set when an arithmetic operation generates a carry, the zero flag
is set when the result of an arithmetic or logical operation is zero, the sign flag is set when the
result of an arithmetic or logical operation is negative, and the parity flag is set when the
result of an arithmetic or logical operation has an even number of 1 bits.
3. The data bus is an 8-bit bus that is used to transfer data between the microprocessor and
memory or other devices. The data bus is bidirectional, which means that it can be used to
read data from memory or write data to memory. The address bus is a 16-bit bus that is used
to address memory and other devices. The address bus is used to select the memory location
or device that the microprocessor wants to access.
4. The control bus is a set of signals that controls the operations of the microprocessor, including
the read and write operations. The control bus includes signals such as the read signal, write
signal, interrupt signal, and reset signal. The read signal is used to read data from memory or
other devices, the write signal is used to write data to memory or other devices, the interrupt
signal is used to signal the microprocessor that an interrupt has occurred, and the reset signal
is used to reset the microprocessor to its initial state.

8085 is an 8-bit, general-purpose microprocessor. It consists of the following functional units:


Arithmetic and Logic Unit (ALU) : It is used to perform mathematical operations like addition,
multiplication, subtraction, division, decrement, increment, etc. Different operations are carried out in
ALU: Logical operations, Bit-Shifting Operations, and Arithmetic Operations.
Flag Register: It is an 8-bit register that stores either 0 or 1 depending upon which value is stored in
the accumulator. Flag Register contains 8-bit out of which 5-bits are important and the rest of 3-bits
are “don’t Care conditions”. The flag register is a dynamic register because after each operation to
check whether the result is zero, positive or negative, whether there is any overflow occurred or not,
or for comparison of two 8-bit numbers carry flag is checked. So for numerous operations to check
the contents of the accumulator and from that contents if we want to check the behaviour of given
result then we can use Flag register to verify and check. So we can say that the flag register is a
status register and it is used to check the status of the current operation which is being carried
out by ALU.

Different Fields of Flag Register:


1. Carry Flag
2. Parity Flag
3. Auxiliary Carry Flag
4. Zero Flag
5. Sign Flag
Accumulator: Accumulator is used to perform I/O, arithmetic, and logical operations. It is connected
to ALU and the internal data bus. The accumulator is the heart of the microprocessor because for all
arithmetic operations Accumulator’s 8-bit pin will always there connected with ALU and in most-off
times all the operations carried by different instructions will be stored in the accumulator after
operation performance.
General Purpose Registers: There are six general-purpose registers. These registers can hold 8-bit
values. These 8-bit registers are B,C,D,E,H,L. These registers work as 16-bit registers when they
work in pairs like B-C, D-E, and H-L. Here registers W and Z are reserved registers. We can’t use
these registers in arithmetic operations. It is reserved for microprocessors for internal operations like
swapping two 16-bit numbers. We know that to swap two numbers we need a third variable hence
here W-Z register pair works as temporary registers and we can swap two 16-bit numbers using this
pair.
Program Counter : Program Counter holds the address value of the memory to the next instruction
that is to be executed. It is a 16-bit register.
For Example: Suppose current value of Program Counter : [PC] = 4000H
(It means that next executing instruction is at location 4000H.After fetching, program Counter(PC)
always increments by +1 for fetching of next instruction.)
Stack Pointer : It works like a stack. In stack, the content of the register is stored that is later used in
the program. It is a 16-bit special register. The stack pointer is part of memory, but it is part of Stack
operations, unlike random memory access. Stack pointer works in a continuous and contiguous part of
the memory. whereas Program Counter(PC) works in random memory locations. This pointer is very
useful in stack-related operations like PUSH, POP, and nested CALL requests initiated by
Microprocessor. It reserves the address of the most recent stack entry.
Temporary Register: It is an 8-bit register that holds data values during arithmetic and logical
operations.
Instruction registers and decoder: It is an 8-bit register that holds the instruction code that is being
decoded. The instruction is fetched from the memory.
Timing and control unit: The timing and control unit comes under the CPU section, and it controls
the flow of data from the CPU to other devices. It is also used to control the operations performed by
the microprocessor and the devices connected to it. There are certain timing and control signals like
Control signals, DMA Signals, RESET signals and Status signals.
Interrupt control: Whenever a microprocessor is executing the main program and if suddenly an
interrupt occurs, the microprocessor shifts the control from the main program to process the incoming
request. After the request is completed, the control goes back to the main program. There are 5
interrupt signals in 8085 microprocessors: INTR, TRAP, RST 7.5, RST 6.5, and RST 5.5.
Priorities of Interrupts: TRAP > RST 7.5 > RST 6.5 > RST 5.5 > INTR
Address bus and data bus: The data bus is bidirectional and carries the data which is to be
stored. The address bus is unidirectional and carries the location where data is to be stored. In the
8085 microprocessors, the address bus and data bus are two separate buses that are used for
communication between the microprocessor and external devices. The Address bus is used to transfer
the memory address of the data that needs to be read or written. The address bus is a 16-bit bus,
allowing the 8085 to access up to 65,536 memory locations. The Data bus is used to transfer data
between the microprocessor and external devices such as memory and I/O devices. The data bus is an
8-bit bus, allowing the 8085 to transfer 8-bit data at a time. The data bus can also be used for
instruction fetch operations, where the microprocessor fetches the instruction code from memory and
decodes it. The combination of the address bus and data bus allows the 8085 to communicate with and
control external devices, allowing it to execute its program and perform various operations.
Serial Input/output control: It controls the serial data communication by using Serial input data and
Serial output data.Serial Input/Output control in the 8085 microprocessor refers to the communication
of data between the microprocessor and external devices in a serial manner, i.e., one bit at a time. The
8085 has a serial I/O port (SID/SOD) for serial communication. The SID pin is used for serial input
and the SOD pin is used for serial output. The timing and control of serial communication is managed
by the 8085’s internal circuitry. The 8085 also has two special purpose registers, the Serial Control
Register (SC) and the Serial Shift Register (SS), which are used to control and monitor the serial
communication.
The flow of an Instruction Cycle in 8085 Architecture :
1. Execution starts with Program Counter. It starts program execution with the next address
field. it fetches an instruction from the memory location pointed by Program Counter.
2. For address fetching from the memory, multiplexed address/data bus acts as an address bus
and after fetching instruction this address bus will now acts as a data bus and extract data
from the specified memory location and send this data on an 8-bit internal bus. For
multiplexed address/data bus Address Latch Enable(ALE) Pin is used. If ALE = 1
(Multiplexed bus is Address Bus otherwise it acts as Data Bus).
3. After data fetching data will go into the Instruction Register it will store data fetched from
memory and now data is ready for decoding so for this Instruction decoder register is used.
4. After that timing and control signal circuit comes into the picture. It sends control signals all
over the microprocessor to tell the microprocessor whether the given instruction is for
READ/WRITE and whether it is for MEMORY/I-O Device activity.
5. Hence according to timing and control signal pins, logical and arithmetic operations are
performed and according to that data fetching from the different registers is done by a
microprocessor, and mathematical operation is carried out by ALU. And according to
operations Flag register changes dynamically.
6. With the help of Serial, I/O data pin(SID or SOD Pins) we can send or receive input/output to
external devices .in this way execution cycle is carried out.
7. While execution is going on if there is any interrupt detected then it will stop execution of
the current process and Invoke Interrupt Service Routine (ISR) Function. Which will stop
the current execution and do execution of the current occurred interrupt after that normal
execution will be performed.
Uses of 8085 microprocessor :
The 8085 microprocessor is a versatile 8-bit microprocessor that has been used in a wide variety of
applications, including:
1. Embedded Systems: The 8085 microprocessor is commonly used in embedded systems, such
as industrial control systems, automotive electronics, and medical equipment.
2. Computer Peripherals: The 8085 microprocessors has been used in a variety of computer
peripherals, such as printers, scanners, and disk drives.
3. Communication Systems: The 8085 microprocessors has been used in communication
systems, such as modems and network interface cards.
4. Instrumentation and Control Systems: The 8085 microprocessor is commonly used in
instrumentation and control systems, such as temperature and pressure controllers.
5. Home Appliances: The 8085 microprocessor is used in various home appliances, such as
washing machines, refrigerators, and microwave ovens.
6. Educational Purposes: The 8085 microprocessor is also used for educational purposes, as it is
an inexpensive and easily accessible microprocessor that is widely used in universities and
technical schools.
Issues in 8085 microprocessor :
Here are some common issues with the 8085 microprocessors:
1. Overheating: The 8085 microprocessor can overheat if it is used for extended periods or if it
is not cooled properly. Overheating can cause the microprocessor to malfunction or fail.
2. Power Supply Issues: The 8085 microprocessor requires a stable power supply for proper
operation. Power supply issues such as voltage fluctuations, spikes, or drops can cause the
microprocessor to malfunction.
3. Timing Issues: The 8085 microprocessor relies on accurate timing signals for proper
operation. Timing issues such as clock signal instability, noise, or interference can cause the
microprocessor to malfunction.
4. Memory Interface Issues: The 8085 microprocessor communicates with memory through its
address and data buses. Memory interface issues such as faulty memory chips, loose
connections, or address decoding errors can cause the microprocessor to malfunction.
5. Hardware Interface Issues: The 8085 microprocessor communicates with other devices
through its input/output ports. Hardware interface issues such as faulty devices, incorrect
wiring, or improper device selection can cause the microprocessor to malfunction.
6. Programming Issues: The 8085 microprocessor is programmed with machine language or
assembly language instructions. Programming issues such as syntax errors, logic errors, or
incorrect instruction sequences can cause the microprocessor to malfunction or produce
incorrect results.
7. Research and development: The 8085 microprocessor is often used in research and
development projects, where it can be used to develop and test new digital electronics and
computer systems. Researchers and developers can use the microprocessor to prototype new
systems and test their performance.
8. Retro computing: The 8085 microprocessor is still used by enthusiasts today for retro
computing projects. Retro computing involves using older computer systems and technologies
to explore the history of computing and gain a deeper understanding of how modern
computing systems have evolved.
Pin diagram of 8085 microprocessor is as given below:

1. Address Bus and Data Bus:


The address bus is a group of sixteen lines i.e A0-A15. The address bus is unidirectional, i.e., bits
flow in one direction from the microprocessor unit to the peripheral devices and uses the high order
address bus.
2. Control and Status Signals:
1. ALE – It is an Address Latch Enable signal. It goes high during first T state of a machine
cycle and enables the lower 8-bits of the address, if its value is 1 otherwise data bus is
activated.
1. IO/M’ – It is a status signal which determines whether the address is for input-output or
memory. When it is high(1) the address on the address bus is for input-output devices. When
it is low(0) the address on the address bus is for the memory.
1. SO, S1 – These are status signals. They distinguish the various types of operations such as
halt, reading, instruction fetching or writing.
IO/M’S1S0Data
Bus Status

0 1 1 Opcode fetch

0 1 0 Memory read

0 0 1 Memory write

1 1 0 I/O read

1 0 1 I/O write

1 1 1 Interrupt acknowledge

0 0 0 Halt

 RD’ – It is a signal to control READ operation. When it is low the selected memory
or input-output device is read.
 WR’ – It is a signal to control WRITE operation. When it goes low the data on the
data bus is written into the selected memory or I/O location.
 READY – It senses whether a peripheral is ready to transfer data or not. If READY is
high(1) the peripheral is ready. If it is low(0) the microprocessor waits till it goes
high. It is useful for interfacing low speed devices.
3. Power Supply and Clock Frequency:
 Vcc – +5v power supply
 Vss – Ground Reference
 XI, X2 – A crystal is connected at these two pins. The frequency is internally divided
by two, therefore, to operate a system at 3MHZ the crystal should have frequency of
6MHZ.
 CLK (OUT) – This signal can be used as the system clock for other devices.
4. Interrupts and Peripheral Initiated Signals:
o The 8085 has five interrupt signals that can be used to interrupt a program execution.
o INTR
o RST 7.5
o RST 6.5
o RST 5.5
o TRAP
 The microprocessor acknowledges Interrupt Request by INTA’ signal. In addition to
Interrupts, there are three externally initiated signals namely RESET, HOLD and READY. To
respond to HOLD request, it has one signal called HLDA.
o INTR – It is an interrupt request signal.
o INTA’ – It is an interrupt acknowledgement sent by the microprocessor after INTR is
received.
5. Reset Signals:
 RESET IN’ – When the signal on this pin is low(0), the program-counter is set to
zero, the buses are tristate and the microprocessor unit is reset.
 RESET OUT – This signal indicates that the MPU is being reset. The signal can be
used to reset other devices.
6. DMA Signals:
 HOLD – It indicates that another device is requesting the use of the address and data bus.
Having received HOLD request the microprocessor relinquishes the use of the buses as
soon as the current machine cycle is completed. Internal processing may continue. After
the removal of the HOLD signal the processor regains the bus.
 HLDA – It is a signal which indicates that the hold request has been received after the
removal of a HOLD request, the HLDA goes low.
7. Serial I/O Ports:
 Serial transmission in 8085 is implemented by the two signals,
 SID and SOD – SID is a data line for serial input where as SOD is a data line for serial
output.
Advantages of the 8085-microprocessor pin diagram:
 The pin diagram is easy to understand and remember because of its logical and systematic
arrangement.
 It has a simple structure with fewer pins compared to other microprocessors, making it easy to
design and implement in electronic circuits.
 It has a dedicated pin for interrupt handling, which makes it easy to interface with external
devices that require interrupt-driven communication.
Disadvantages of the 8085-microprocessor pin diagram:
 It has limited addressing capability due to its 8-bit architecture, which can limit its use in
applications that require large amounts of memory.
 It has a limited number of pins, which can be a constraint in designing complex systems that
require more input/output devices or peripherals.
 It has separate pins for input/output and memory access, which can make it more difficult to
design memory-mapped input/output circuits.

Addressing Mode
The 8085 microprocessor has several addressing modes that are used to access memory
locations. Some of the most commonly used addressing modes in the 8085 microprocessor are:
The way of specifying data to be operated by an instruction is called addressing mode.
Why use addressing modes in 8085 microprocessor ?
Here are some reasons why addressing modes are used in the 8085 microprocessor:
1. Flexibility: Addressing modes provide a flexible way to access data and instructions in
memory. Different addressing modes allow programmers to choose the most appropriate
addressing technique for a particular task, depending on the type of data being accessed, the
size of the data, and other factors.
2. Memory optimization: Addressing modes can help to optimize the use of memory resources
by allowing data and instructions to be accessed in the most efficient way possible. For
example, using indirect addressing modes can reduce the amount of memory needed to store
addresses, while using indexed addressing modes can reduce the number of memory accesses
needed to access a large array of data.
3. Performance optimization: Addressing modes can also help to optimize the performance of
the microprocessor by reducing the number of memory accesses needed to fetch data or
instructions. This can help to speed up the execution of programs and improve the overall
efficiency of the microprocessor.
4. Reduced code size: Addressing modes can help to reduce the size of code needed to perform a
particular task. By using addressing modes that allow data and instructions to be accessed
using fewer instructions, programmers can write more compact and efficient code.
Types of addressing modes –
In 8085 microprocessor there are 5 types of addressing modes:
1.Immediate Addressing Mode – In immediate addressing mode the source operand is always data.
If the data is 8-bit, then the instruction will be of 2 bytes, if the data is of 16-bit then the instruction
will be of 3 bytes.
Examples:
MVI B 45 (move the data 45H immediately to register B)
LXI H 3050 (load the H-L pair with the operand 3050H immediately)
JMP address (jump to the operand address immediately)
2.Register Addressing Mode – In register addressing mode, the data to be operated is available
inside the register(s) and register(s) is(are) operands. Therefore the operation is performed within
various registers of the microprocessor.
Examples:
MOV A, B (move the contents of register B to register A)
ADD B (add contents of registers A and B and store the result in register A)
INR A (increment the contents of register A by one)
3.Direct Addressing Mode – In direct addressing mode, the data to be operated is available inside a
memory location and that memory location is directly specified as an operand. The operand is directly
available in the instruction itself.
Examples:
LDA 2050 (load the contents of memory location into accumulator A)
LHLD address (load contents of 16-bit memory location into H-L register pair)
IN 35 (read the data from port whose address is 35)
4.Register Indirect Addressing Mode – In register indirect addressing mode, the data to be operated
is available inside a memory location and that memory location is indirectly specified by a register
pair.
Examples:
MOV A, M (move the contents of the memory location pointed by the H-L pair to the accumulator)
LDAX B (move contents of B-C register to the accumulator)
STAX B (store accumulator contents in memory pointed by register pair B-C)
5.Implied/Implicit Addressing Mode – In implied/implicit addressing mode the operand is hidden
and the data to be operated is available in the instruction itself.
Examples:
CMA (finds and stores the 1’s complement of the contents of accumulator A in A)
RRC (rotate accumulator A right by one bit)
RLC (rotate accumulator A left by one bit)
6.Relative Addressing Mode - In this mode, the operand is a memory location specified by the
contents of the program counter plus a constant value.
example:
MOV R0,#05H
AGAIN:
MVI A,#55H
ADD A,R0
JMP AGAIN
In this example, the instruction JMP AGAIN uses the Relative Addressing Mode. The instruction
jumps to the label AGAIN by adding the contents of the program counter with the specified constant
value. The constant value is calculated based on the distance between the current instruction and the
label AGAIN.
In this case, the instruction JMP AGAIN is executing a loop that loads the accumulator with the value
55H, adds the contents of the register R0 to the accumulator, and then jumps back to the label AGAIN
to repeat the loop.
Features of the addressing modes in the 8085 microprocessor:
1. Immediate addressing: In immediate addressing mode, the operand is a constant value that
is part of the instruction. The immediate addressing mode is used for instructions that require
a fixed value, such as loading a constant value into a register.
2. Direct addressing: In direct addressing mode, the operand is a memory address specified
directly in the instruction. The direct addressing mode is used for instructions that access data
stored in memory.
3. Indirect addressing: In indirect addressing mode, the operand is a memory address specified
indirectly by a register or memory location. The indirect addressing mode is used for
instructions that access data stored in memory, where the memory address is not known in
advance.
4. Register addressing: In register addressing mode, the operand is stored in one of the
processor registers. The register addressing mode is used for instructions that manipulate the
contents of the registers.
5. Indexed addressing: In indexed addressing mode, the operand is obtained by adding an
offset value to a base address stored in a register. The indexed addressing mode is used for
instructions that access data stored in memory using a computed address.
6. Relative addressing: In relative addressing mode, the operand is specified as an offset
relative to the current program counter value. The relative addressing mode is used for
instructions that perform conditional branching or looping.
7. Memory-mapped I/O addressing: In memory-mapped I/O addressing mode, the processor
accesses input/output devices using memory addresses instead of specialized I/O instructions.
Memory-mapped I/O addressing mode is used for interfacing with peripherals such as
displays, keyboards, and printers.
Advantages of Addressing Modes in 8085 Microprocessor:
1. Versatility: The 8085 microprocessor supports several addressing modes, which allows for a
wide range of memory access and manipulation options.
2. Efficient memory usage: Different addressing modes allow for efficient use of memory,
reducing the memory footprint of programs and making the best use of available memory.
3. Easy to use: The addressing modes are easy to use, making it simple for programmers to
write and execute complex programs.
4. Improved performance: The use of different addressing modes can improve the
performance of programs, as the correct addressing mode can be chosen to match the specific
requirements of the program.
Disadvantages of Addressing Modes in 8085 Microprocessor:
1. Complexity: The various addressing modes can be complex, making it difficult for
programmers to choose the correct mode for a given task.
2. Overhead: The use of different addressing modes can result in additional overhead, as the
microprocessor must perform additional operations to access memory.
3. Debugging difficulties: Debugging programs that use multiple addressing modes can be
difficult, as the programmer must keep track of the different modes used in each memory
access.
4. Limitations: The addressing modes are limited by the size of the program counter and the
memory address space, which can impact the performance of large programs.
Uses of Addressing Modes in 8085 Microprocessor:
Here are some of the most common uses of addressing modes in the 8085 microprocessor:
1. Direct addressing: Direct addressing is used when the address of the operand is directly
specified in the instruction. This addressing mode is used for simple operations where the
operand is stored in a specific memory location, and the address does not need to be
calculated or manipulated in any way.
2. Indirect addressing: Indirect addressing is used when the address of the operand is not directly
specified in the instruction, but is instead stored in a register or memory location. This
addressing mode is useful for accessing data stored in memory that may be located at a
different address each time the program is executed.
3. Immediate addressing: Immediate addressing is used when the operand is specified directly in
the instruction, rather than being stored in memory. This addressing mode is useful for
performing simple arithmetic or logic operations on constants or literals.
4. Register addressing: Register addressing is used when the operand is stored in a register,
rather than in memory. This addressing mode is useful for performing fast arithmetic or logic
operations on small amounts of data.
5. Indexed addressing: Indexed addressing is used when the address of the operand is calculated
by adding an offset value to the contents of a register. This addressing mode is useful for
accessing elements of an array or data structure.
6. Relative addressing: Relative addressing is used when the address of the operand is calculated
relative to the current program counter. This addressing mode is useful for branching to
different parts of a program or for accessing data stored in a specific location relative to the
current program counter.
Challenges associated with addressing modes in the 8085 microprocessor, including:
Limited addressing range: The 8085 microprocessor has a 16-bit address bus, which limits the
number of memory locations that can be accessed directly. This can be a challenge when working
with large data sets or programs that require access to a lot of memory.
Complex instruction set: The 8085 microprocessor has a relatively complex instruction set, which
can make it difficult to understand and use the various addressing modes correctly. This can lead to
errors in programming and result in unexpected behavior.
Limited addressing modes: The 8085 microprocessor has a limited set of addressing modes, which
can limit its flexibility and make certain types of programming tasks more difficult. For example, the
lack of an indexed addressing mode can make it more difficult to work with arrays or other data
structures.
Stack management: The use of the stack pointer register can be challenging, especially when dealing
with nested subroutine calls or interrupts. Improper use of the stack can lead to memory corruption
and program crashes.
Performance considerations: Some addressing modes, such as direct addressing, can be faster than
others, such as register indirect addressing. This means that programmers need to carefully consider
which addressing modes to use to optimize the performance of their programs.
Memory management: The 8085 microprocessor does not have built-in support for virtual memory
or paging, which can be a challenge when working with large programs or data sets that exceed the
available physical memory. Programmers need to manage memory usage carefully to avoid memory-
related errors and crashes.

Looping in 8085
Looping is a programming technique that instructs the Microprocessor to repeat tasks. It is
accomplished by changing the sequence of execution using jump instructions.
Loops can be classified into two groups:
1. Continous Loops.
2. Conditional Loops.
Continous Loops
A continuous loops repeats a task continuously. It is setup by using unconditional jump instruction. A
program with a continuous loop will keep repeating tasks until the system is reset as shown in the
flowchart.

Conditional Loops
A conditional loop repeat a task if some conditions are satisfied. They are setup by conditional jump
instructions. These instructions check flags(Z, CY, P, S) and repeat the tasks based on the flag values.
These loops include counting and indexing.
Conditional Loop and Counter
A counter is a typical application of the conditional loop. To achieve the looping task, the
microprocessor requires a counter and a flag. A counter is set up by loading a suitable count into a
register. Counting is accomplished by either incrementing or decrementing the counter. A conditional
jump instruction creates the loop and the end of counting is indicated by a flag.
The following flowchart illustrates the approach needed for the microprocessor to repeat a task five
times.

Indexing
Pointing objects with sequential numbers is called indexing. Data bytes are stored in memory
locations and are referred to by their memory locations.
Delay Generation in 8085
The counting method described above has a significant downside in that it is performed at such a high
speed that only the final count can be seen. So to notice the counting, there must be an appropriate
time delay between counts.
Depending on the time delay required, a register is loaded with a number, and then the register is
decremented until it reaches zero by setting up a loop with a conditional jump instruction. The delay
is caused by the loop, which is determined by the system’s clock period.

The following methods are used for generating delays:


1. Using NOP instructions.
2. Using 8-bit register as counter.
3. Using 16-bit register pair as counter.
Using NOP Instructions
One of the most common applications of the NOP instruction is in the generation of delays. The NOP
instruction requires four clock pulses to fetch, decode, and execute. As a result, this form of NOP
instruction can be used to induce a few milliseconds of time delay.
Time Delay Using One Register
The following program will demonstrate the time delay using 8-bit counter.
MVI B, FFH
LOOP: DCR B
JNZ LOOP
RET
The first instruction will be executed once, which will take 7 T-states. The DCR C instruction requires
4 T-states. This will be executed 255 (FF) times. The JNZ instruction takes 10 T-states when it jumps
(It jumps 254 times), otherwise it will take 7 T-States. The RET instruction requires 10 T-States.
So we can use this technique with some other values in the place of FF, when we need some small
delay.
Time Delay Using a Register Pair
Instead of an 8-bit counter, we can do the same task with a 16-bit register pair. More time delay can be
generated using this method. For example:
LXI B,FFFFH
LOOP: DCX B
MOV A,B
ORA C
JNZ LOOP
RET
This method can be used to get more than 0.5 seconds delay.

You might also like