0% found this document useful (0 votes)
18 views76 pages

Unit 1

Uploaded by

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

Unit 1

Uploaded by

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

FUNDAMENTALS OF MICROPROCESSOR

UNIT 1
INTRODUCTION TO INTEL 8085
By:
ATIFA AQUEEL
Electronics Engg. Section
University Women’s Polytechnic, AMU

20-09-2022 By: Atifa Aqueel 1


SyLLabUS
I. INTRODUCTION TO THE INTEL 8085
• Definition of microprocessor, Generations and types of microprocessors,
Architecture of 8085, Brief description of ALU, register section, data &
address buses, 8085 CPU pins and associated signal.
II. PROGRAMMING THE 8085
• Instruction, Group of instruction, Addressing modes of 8085 Instructions,
8085 Instruction set, Machine Language, Assembly Language comparison,
Assembly Language programming (Simple Problems).
III. TIMING INSTRUCTION & EXECUTION
• Machine, Instruction, Fetch, Read, Write (IO/MEM) cycle timing diagram,
Interruption: Types of 8085 interrupt system, 8085 SID and SOD lines.

20-09-2022 By: Atifa Aqueel 2


SyLLabUS
IV. PERIPHERAL INTERFACING
• PPLD’S, Brief description of 8255, 8257-DMA Controller, Introduction to
Intel’s 8086 microprocessor, popular applications of Microprocessor in
industry.
• BOOKS RECOMMENDED:-
1. Microprocessor Architecture, Programming & Applications, by Goankar,
6th Edition 2013
2. Fundamentals of Microprocessor and Microcontrollers, by B.Ram,
Dhanpat Rai Publications, 9th edition 2019.
3. Microprocessor and Microcomputers by Rafiquzzaman, Universal Book
Stall (UBS Pub.) 1997
4. Introduction to Microprocessor, by Mathur, 3rd Edition 1997, Aditya P
Mathur (Tata McGraw Hill, Pub. Co.Ltd)

20-09-2022 By: Atifa Aqueel 3


QUESTIONS
• Why are you learning this subject?
• Where are these microprocessors used?
• Is there a µP in Normal Fan?
• Is there a µP in Tubelight?
• Is there a µP in Remote Control, mobile Phone , Computer?
• Where do we require microprocessors?
• (wherever programming is involved µP is used)

20-09-2022 By: Atifa Aqueel 4


baSICS
Instruction Cycle MICROCOMPUTER
1.Fetch
2.Decode A-Bus
3.Execute B-Bus
PROCESSOR
MEMORY
HLL: a=b+c
ALL: ADD B, C C-Bus
Bin : 01101011

I/O DEVICES
Compiler: HLL to ML
Assembler: ALL to ML

20-09-2022 By: Atifa Aqueel 5


DECODINg
(Understanding the ‘opcode’)
Microprocessor Memory
Address Opcode/
Data

00
2 to 4 Decoder
00

00
+ - X /
11

OP (ML) – INS(AL)
Consider very simplest µp that has only 00 – ADD
4 instructions: ADD, SUB, MULT, DIV, 01 – SUB
so there will be only 4 opcodes. 10 – MULT
20-09-2022 By: Atifa Aqueel 11 – DIV 6
baSICS Of bINaRy aND HExaDECImaL
Everything stored inside a computer is in binary form i.e 0s and 1s.

Decimal Binary Hexadecimal Binary


8 4 2 1
0 0 0 0 0 0-9
1 0 0 0 1 A 1 0 1 0
2 0 0 1 0 B 1 0 1 1
3 0 0 1 1 C 1 1 0 0

6 4 0 1 0 0 D 1 1 0 1
combina 5 0 1 0 1 E 1 1 1 0
tion are
forbidde 6 0 1 1 0 F 1 1 1 1
n in
decimal 7 0 1 1 1
represen
tation 8 1 0 0 0
9 1 0 0 1
20-09-2022 By: Atifa Aqueel 7
baSICS Of bINaRy aND
HExaDECImaL
• ADD 0001+1001 =1010 (No such no. is present in decimal system)
• Using 4 bits always need 16 combinations (we need to name each of those
combinations)
• There came the need for creating a new system which has 16
representations. i.e. Hexadecimal numbers
• In decimal system maximum 4 digit no. is 9999 while in hexadecimal it is
FFFF (65536). Both are using the same space.
• Therefore in computers we do not use decimal numbers.
Hexadecimal Binary 8 BIT NO.
00H (8 ZEROES)
00 H …….
35H FFH (8 ONES)
74H 16 BIT NO.
0000H (16 ZEROES)
93H
…….
20-09-2022 FFH By: Atifa Aqueel FFFFH (16 ONES) 8
1 byte = 8 bits
1 nibble = 4 bits
1 word = 16 bits POwERS Of 2
• In this subject everything is in binary so every number is in some power of
2.
20 1 211 21 x 210 = 2K
21 2 212
22 4 213
23 8 216
24 16 220 210 x210= 1K x 1K =1M
25 32 224 16M
26 64 230 210 X210 X210 =1K X1KX1K=1G
27 128 240 1T
28 256 243
29 512 236
210 1024 or 1K 239
Or 1Kilo
1GB = 1 gigabytes, whereas 1Gb = 1 gigabits
20-09-2022 By: Atifa Aqueel 9
4GB RAM means 232bytes
DEfINITION
• A microprocessor is a controlling unit of a micro-computer wrapped inside
a small chip. It performs Arithmetic Logical Unit (ALU) operations and
communicates with the other devices connected with it. It is a single
Integrated Circuit in which several functions are combined. It is
abbreviated as µP.
• Microprocessors are used almost everywhere. Some common household
items where you are likely to find a microprocessor are washing machines,
microwave ovens, laptops, digital clocks and smartphones.

8085 is the first commerciallyBy:successful


20-09-2022 Atifa Aqueel
Microprocessor of Intel10
HISTORy Of mICROPROCESSOR

• Fairchild Semiconductors invented the first IC (Integrated Circuit)


in 1959.
• In 1968, Robert Noyce, Gordan Moore, Andrew Grove found their
own company Intel.
• Intel grew from 3 man start-up in 1968 to industrial giant by 1981.
• In 1971, INTEL created the first generation Microprocessor 4004
that would run at a clock speed of 108 kHz
• From 1973 to 1978, second-generation 8-bit microprocessors were
fabricated like Motorola 6800 and 6801, INTEL-8085, and Zilog's-
Z80.
• In 1978, Intel 8008 third-generation process came into the market.
• In the early 80s, Intel released fourth-generation 32-bit processors.
• In 1995, intel released in fifth-generation 64-bit processors .

20-09-2022 By: Atifa Aqueel 11


HISTORy Of mICROPROCESSOR

20-09-2022 By: Atifa Aqueel 12


TyPES Of mICROPROCESSOR
• Important types of Microprocessors are:
1. Complex Instruction Set Microprocessors (CISCs)
2. The Application Specific Integrated Circuit (ASICs)
3. Reduced Instruction Set Microprocessors (RISCs)
4. Digital Signal Multiprocessors (DSPs)

Q1 (H.A1): Write in detail about the generations and different types of


microprocessors.

20-09-2022 By: Atifa Aqueel 13


aPPLICaTIONS Of mICROPROCESSOR

• Microprocessors are mainly used in devices like:


• Calculators
• Accounting system
• Games machine
• Complex industrial controllers
• Traffic light
• Control data
• Military applications
• Defence systems
• Computation systems
20-09-2022 By: Atifa Aqueel 14
mICROCONTROLLER
• A microcontroller is a chip optimized to control electronic devices. It is
stored in a single integrated circuit which is dedicated to performing a
particular task and execute one specific application.

• It is specially designed circuits for embedded applications and is widely


used in automatically controlled electronic devices. It contains memory,
processor, and programmable I/O in a single package.

20-09-2022 By: Atifa Aqueel 15


mICROPROCESSOR VS mICROCONTROLLER

• According to the definition of microprocessor,


• It is an electronic IC which works as a computer processor and is present in
single or multiple integrated circuits (IC’s). The function of microprocessor
is to perform all the functions of the central processing system.
• Don’t confuse it with Central Processing Unit (CPU), as this resides on
single or multiple integrated circuits and doesn’t occupy much space like
CPU does.
• As per the definition of Microcontroller,
• It is an electronic Integrated Circuit (IC) which contains processing unit
along with the other required peripheral components with fixed sized RAM
and ROM. It is also known as the small computer in an Small IC.

20-09-2022 By: Atifa Aqueel 16


aNaLOgy
• Microprocessors are a key element to any electronic component. You will find
them in any system that requires logic, no matter how small or simple.
• Much like a microprocessor, a microcontroller is the nervous system of a body.
• Whilst the former “processes” data, the latter “controls” data and peripherals.
• Think of it as both sides of the brain: one is the thinking side, whereas the other
one is the motor skills and expressive side.
• On its own, a microprocessor won’t do much; It’s like a brain without a body.
• Slap on a nervous system (busses), some limbs (IO) and a beating heart (crystal
clock) and you’ve got yourself a microcontroller.
• The most common example of these is an Arduino Uno.
• Microcontrollers and Microcomputers; both of which are essentially the same
but built for different purposes: the microcontroller does basic logic and
requires little time and components to do so, whilst the microcomputer does
heavier computation and requires a longer time and more power to do so.

20-09-2022 By: Atifa Aqueel 17


mICROPROCESSOR VS mICROCONTROLLER

• Microprocessor consists of only a Central Processing Unit, whereas Micro


Controller contains a CPU, Memory, I/O all integrated into one chip.
• Microprocessor is used in Personal Computers whereas Micro Controller is
used in an embedded system.
• Microprocessor uses an external bus to interface to RAM, ROM, and other
peripherals, on the other hand, Microcontroller uses an internal controlling
bus.
• Microprocessors are based on Von Neumann model Micro controllers are
based on Harvard architecture
• Microprocessor is complicated and expensive, with a large number of
instructions to process but Microcontroller is inexpensive and
straightforward with fewer instructions to process.

20-09-2022 By: Atifa Aqueel 18


Microcontroller
Microprocessor

20-09-2022 By: Atifa Aqueel 19


ORgaNIzaTION Of µP baSED SySTEm
Microcomputer

Microprocessor

Microprocessor based system with Bus architechture

20-09-2022 By: Atifa Aqueel 20


CONTD…
• Figure shows a simplified but formal structure of a microprocessor-based
system.
• It includes four components: microprocessor. input, output; and memory
(Read/Write Memory and Read-Only Memory).
• These components are organized around .a common communication path
called a bus.
• The entire group of components is also referred to as a system or a
microcomputer system, and the components themselves are referred to as
sub-systems.

Microprocessor Vs Microcomputer
The microprocessor is one component of the microcomputer. On the other
hand, the microcomputer is a complete computer similar to any other computer,
except that the CPU functions of the microcomputer are performed by the
microprocessor.

20-09-2022 By: Atifa Aqueel 21


1. MICROPROCESSOR:
• The microprocessor is the brain of the microcomputer.
• It is a semiconductor device consisting of electronic logic circuits
manufactured by using either a large-scale (LSI) or very-large-scale integration
(VLSI) technique.
• The microprocessor is capable of performing various computing functions and
making decisions to change the sequence of program execution.
• It fetches stored instructions and data word from the memory sequentially,
decode it, execute it and then store the result in memory.
• The major components of a microprocessor are ALU, register array and control
unit.
a. ALU (Arithmetic and Logic Unit): This section performs computing
functions (ADD, SUB, AND, OR, XOR etc.) on data.
b. Register Array: This section consists of various registers. These registers are
primarily used to store data temporarily during the execution of a program.
c. Control Unit: The control unit provides the necessary timing and control
signals to all the operations in the microcomputer, it controls the flow of data
between the microprocessor and memory and peripherals .

20-09-2022 By: Atifa Aqueel 22


2. MEMORY:
• Memory stores such binary information as instructions and data, and provides
that information to the microprocessor.
• To execute programs, the microprocessor reads instructions and data from
memory and performs the computing operations in its ALU section.
• Results are either transferred to the output section for display or stored in
memory for later use.
• The memory block has two sections: Read-Only Memory (ROM) and Read/
Write Memory (R/WM), popularly known as Random-Access Memory (RAM).
a) Read-Only Memory (ROM): The ROM is used to store programs that do not
need alterations. The monitor program of a single-board microcomputer is
generally stored in the ROM.
b) Read/ Write Memory (R/WM): The Read/Write Memory (R/WM) is also
known as user memory . It is used to store user programs and data. The
information stored in this memory can be easily read and altered.
20-09-2022 By: Atifa Aqueel 23
3. INPUT AND OUTPUT DEVICES:
• The third component of microprocessor based system is I/O devices. The
microprocessor communicates with the outside world through these devices.

• The I/O devices are also called peripherals.

• The input devices such as keyboard, mouse, switches and A/D converters
are used to transfer binary information from outside world to the
microprocessor.

• The output devices such as LEDs, Cathode Ray Tubes (CRTs), printers, X-
Y plotters, D/A converters transfer data from the microprocessor to the
outside world.

20-09-2022 By: Atifa Aqueel 24


bUS ORgaNIzaTION Of 8085
mICROPROCESSOR
• Bus is a group of conducting wires which carries information, all the
peripherals are connected to microprocessor through Bus.
• It is a communication path between microprocessor and
memory/peripherals.

20-09-2022 By: Atifa Aqueel 25


BLOCK DIAGRAM
Mem.Read Memory

A-Bus ADDRESS OP/Data

D-Bus
1000H 45H
PROCESSOR
C-Bus
4000H

Mem. Write4001H

Input Read Output write

I/O DEVICES

20-09-2022 By: Atifa Aqueel 26


• There are three different types of buses used in microprocessor
1. Address Bus
2. Data Bus
3. Control Bus
• ADDRESS BUS (A-Bus): It is a group of conducting wires which are
used to carry the address of memory and I/o devices
• Address bus is unidirectional because data flow in one direction, from
microprocessor to memory or from microprocessor to Input/output
devices.
• The address bus of INTEL 8085 is of 16bits ranging from 0000 H to FFFF
H, (H denotes Hexadecimal).
• The microprocessor 8085 can transfer maximum 16 bit address which
means it can address up to 216 or 65, 536 (64K) different memory location.
• The Length of the address bus determines the amount of memory a system
can address. Such as a system with a 32-bit address bus can address 2^32
memory locations.
20-09-2022 By: Atifa Aqueel 27
• DATA BUS (D-Bus):
• It is a group of conducting wires which carries Data only.
• Data bus is bidirectional because data flow in both directions, from
microprocessor to memory or Input/Output devices and from memory or
Input/Output devices to microprocessor.
• Length of Data Bus of 8085 microprocessor is 8 Bit (That is, two Hexadecimal
Digits), ranging from 00 H to FF H. (H denotes Hexadecimal).
• When it is write operation, the processor will put the data (to be written) on the
data bus.
• When it is read operation, the memory controller will get the data from specific
memory block and put it into the data bus.
• The width of the data bus is directly related to the largest number that the bus
can carry, such as an 8 bit bus can represent 2 to the power of 8 unique values,
this equates to the number 0 to 255.
• The word length of a processor depends on the width of data bus that’s why
Intel 8085 is called as 8-bit processor.
• Similarly a 16-bit processor has 16 bit data bus.

20-09-2022 By: Atifa Aqueel 28


• CONTROL BUS (C-Bus):
• It is a group of conducting wires, which is used to carry necessary control
signals between the microprocessor and memory and I/O devices.
• Microprocessor uses control bus to process data, that is what to do with
selected memory location.
• Examples of control signals are IO :
• The µP issues IO/ signal to indicate whether it will communicate with IO
device or memory.
• If IO/ signal is high, µP wants to communicate with an IO device.
• If IO/ signal is low, µP wants to communicate with an memory.
• When the µP sends a low signal, it means µP wants to read information.
• When the µP sends a low signal, it means µP will perform write operation
i.e it will send data to the device.
20-09-2022 By: Atifa Aqueel 29
CONTD…

Control Signals IO/

Memory Read 0 0 1

Memory Write 0 1 0

I/O Read 1 0 1

I/O Write 1 1 0

20-09-2022 By: Atifa Aqueel 30


mEmORy aDDRESSINg CaPabILITy Of
a mICROPROCESSOR
• The memory addressing capability of a microprocessor depends on the
width of its address bus.
• If a microprocessor has N address lines, it can directly address 2N memory
locations.
• If a microprocessor has 16 address lines, it can directly address 216 or
65536 or 64K memory locations. (216 = )
• One memory location stores 1 byte information. Hence a microprocessor
having 16 address lines can directly address 64K bytes of memory.
• Therefore, the addressing capability of a microprocessor is 2N bytes where
N= No.of address lines

1 byte = 8 bits
1 nibble = 4 bits
1 word = 16 bits
20-09-2022 By: Atifa Aqueel 31
8085 µP aRCHITECTURE

20-09-2022 By: Atifa Aqueel 32


Program Execution
Memory
ADDRESS OP/Data

Program Counter Address Bus

Instruction 2000H 1st


Data Bus
Register
2001H 2nd
Instruction
Control Bus 2002H 3rd
Decoder
2003H 4th
.
.
.
2009H 10th

20-09-2022 By: Atifa Aqueel 33


KEy fEaTURES
• Some key features of 8085 Microprocessor.
1. The Intel 8085 is an 8-bit general-purpose microprocessor.
2. It has an 8-bit data bus. This means that 8 bits of data can flow around in the
innards of the microprocessor.
3. Apart from the data bus, it also has a 16-bit address bus, which addresses up
to 64KB.
4. It also has a 16-bit program counter & a 16-bit stack pointer.
5. There are six 8-bit registers which are arranged in pairs: BC, DE, HL.
6. It requires a voltage supply of +5V to operate at 3.2MHZ single-phase clock
frequency
7. The Intel 8085 comes as a 40-pin IC package.
8. It has 74 basic instructions and 246 opcodes.

The 8085 is based on Von-Neumann architecture, where the data and instructions
are in the same memory space without any distinction between them.

20-09-2022 By: Atifa Aqueel 34


THE aRCHITECTURE Of THE 8085
• Clearly, we can see the different functional units in the architecture:
1. Accumulator
2. Arithmetic and Logic Unit
3. General-purpose register
4. Program counter
5. Stack pointer
6. Temporary register
7. Flag register
8. Instruction register and decoder
9. Timing and control unit
10. Serial Input/output control
11. Interrupt Control
12. Address buffer and address-data buffer
13. Address bus and data bus
20-09-2022 By: Atifa Aqueel 35
8085 µP aRCHITECTURE
• Fig. shows the block diagram of INTEL 8085 microprocessor.
It consists of three main sections:
1. Arithmetic and Logic Unit (ALU)
2. Timing and control unit
3. Register Array

20-09-2022 By: Atifa Aqueel 36


Arithmetic and Logic Unit (ALU)
• The primary functioning of the ALU is arithmetic & logical operations –
these include
• Addition
• Subtraction
• Incrementing (Add 1)
• Decrementing (Subtract 1)
• Logical tasks like OR, AND, XOR
• Complement (Logical NOT)
• Left shift or the right shift, etc.
• It uses the data from memory and always stores the result of all operations
in the Accumulator.

20-09-2022 By: Atifa Aqueel 37


Timing and control unit
• The timing and control unit acts as the brain of microprocessor system.
• This component produces all the timing & control signal for all the
microprocessor operation.
• This unit synchronizes all the microprocessor operations with the internal
clock and generates the necessary control signals for communication
between the 8085 and the peripherals.
• Given below are the timing & control signals which control the external
and internal circuits −
– Control Signals: READY, RD’, WR’, ALE
– Status Signals: S0, S1, IO/M’
– DMA Signals: HOLD, HLDA
– RESET Signals: RESET IN, RESET OUT

20-09-2022 By: Atifa Aqueel 38


Register Array
• Fig. shows the various registers of INTEL 8085.
• Registers are used by the microprocessor for temporary storage and
manipulation of data and instructions.
• Data remain in the register till they are sent to the memory or I/O devices.
• In large computers the no. of registers are more and hence the program
requires less transfer of data to/from the memory.
• In small computers the no. of registers are small due to limited size of the
chip.
• Intel 8085 has the following registers:
1. One 8-bit Accumulator i.e. Register A
2. Six 8-bit general purpose registers. These are B, C, D, E, H & L.
3. One 16-bit Program Counter, PC
4. One 16-bit Stack Pointer, SP
5. Instruction Register (IR)
6. Temporary Register (TR)

20-09-2022 By: Atifa Aqueel 39


1. ACCUMULATOR (A, 8 bits)
• The accumulator sometimes referred to as ‘Acc’, is an 8-bit register which
is connected to the internal data bus and the ALU.
• It is used to hold one of the operands of an arithmetic and logic operations.
• It serves as one of the inputs to the ALU.
• The other operand for an arithmetic and logic operation may be stored
either in the memory or in one of the general purpose registers.
• The outcome (final result) of the operations carried out by the ALU (the
Arithmetic and Logical Operations) are stored in the accumulator.
• There are some exceptions where only one operand is required for an
instruction.
• This operand is held in the accumulator and the result is also stored in the
accumulator.
• The accumulator is also referred to as register A.

20-09-2022 By: Atifa Aqueel 40


2. General Purpose Registers
• The Intel 8085 has six 8-bit general-purpose registers, namely B, C, D, E,
H and L.
• Each register can hold data of 8-bits.
• We can also use these registers in pairs – BC, DE and HL. When in pairs,
these registers can contain 16-bit data. They are called Register-pair.
• These three are valid register pairs. The programmer can not form a
register-pair by selecting any two register of his choice.
• The H-L pair is also used to act as a memory pointer and for this purpose it
holds the 16-bit address of a memory location.
• The general purpose registers and the accumulator are accessible to
programmer.
• For eg. LXI H 3000H : Load HL pair with 3000H
(HL can be used to store data as well as address)
• MOV M, A : Move the content of acc. To memory location 3000H

20-09-2022 By: Atifa Aqueel 41


3. Program Counter (PC, 16-bits)
• Let us consider that an instruction is being executed by the microprocessor.
When the ALU finishes executing one instruction, it begins searching for
the next instruction to be performed. Thus, there is a requirement of
keeping the next instruction’s address ready to be executed, in order to save
time. This is taken care of by the program counter.
• Program counter is a 16-bit special purpose register which is used to hold
the address of the next instruction to be fetched or executed.
• It keeps the track of the memory address of the instructions in a program
while they are being executed.
• The µP increments the content of the PC during the execution of previous
instruction, so that it points the address of the next instruction in a program.

20-09-2022 By: Atifa Aqueel 42


Instruction Register and Decoder
INSTRUCTION REGISTER:
• The 8085 places the contents of the PC onto the Address bus and fetches
the instruction.
• This fetched instruction is stored into the Instruction register.
• The instruction register holds the opcode (operation code or instruction
code) of the instruction which is being decoded and executed.

INSTRUCTION DECODER:
• The fetched instruction from the Instruction register enters the Instruction
Decoder.
• Here the instruction is decoded and the decode information is given to the
Timing and Control Circuit to issue the necessary timing and control
signals for the execution of the particular instruction.

20-09-2022 By: Atifa Aqueel 43


Temporary and Internal Registers
TEMPORARY REGISTER (8-BITS):
• This is an 8-bit register associated with ALU.
• It is used by μP for storing one of the operands during an operation.
• The programmer has NO ACCESS to this register.
• It is used by the microprocessor only.

INTERNAL REGISTER (WZ, 16-bits):


• This is a 16-bit register pair (two 8-bit temporary registers).
• It is used by μP to hold temporary values in some instructions like
CALL/JMP etc.
• This is used to hold the 16-bit operand temporarily during the execution of
intermediate stages of instruction.
• DE HL

WZ
• The programmer has no access to this register pair.
• It is used for swapping the content of two register pair.
20-09-2022 By: Atifa Aqueel 44
Status Flags (Flag Registers)

• Flag register contents. D1, D3 and D5 slots are empty. A lot of processors have
these ’empty’ register slots in their designs to accommodate future design updates.

20-09-2022 By: Atifa Aqueel 45


Status Flags (Flag Registers)
• The 8085 has an 8-bit flag register, but there are only five active flag bits.
• They are – S, Z, AC, P and CY.
• Flags are basically flip-flops which are used to show the status of some
units of the 8085 after the completion of their respective operations.
• These flip-flops are either set or reset as per the condition of the result in
the registers.
1. Sign Flag (S)
• It occupies the 7th bit of the flag register also known as the most significant
bit (MSB).
• The sign flag indicates whether the result of an arithmetic / logical
operation is positive or negative.
• If the flag is set, i.e. S = 1, the result of the recently carried out operation is
negative; whereas if the result turns out to be positive, the flag is reset, i.e.
S=0.

20-09-2022 By: Atifa Aqueel 46


Status Flags (Flag Registers)
2. Zero Flag (Z)
• It occupies the 6th bit of the flag register.
• The zero flag indicates whether the output of an arithmetic / logical operation
turns out to be zero or not.
• If the result of the most recent operation is zero, the flag will be set (i.e. Z=1).
Else, the flag will be simply reset (Z=0).
• This flag’s value is changed after the ALU operation by the result stored in the
accumulator and other registers.
• It helps in determining if two numbers are equal or not.

3. Auxiliary Carry Flag (AC):


• It occupies the 4th bit of the flag register.
• It is set when an Auxiliary Carry / Borrow is generated.
• It is reset when an Auxiliary Carry / Borrow is not generated.
• Auxiliary Carry is the Carry generated between the lower nibble and the
higher nibble for an 8-bit operation. It is not affected after a 16- bit operation.
It is used only in DAA operation.
20-09-2022 By: Atifa Aqueel 47
Status Flags (Flag Registers)
4. Parity Flag (P):
• It occupies the 2nd bit of the flag register.
• Parity is used to indicate whether a number is of even parity (has even
number of 1’s in the binary number) or of odd parity (has an odd number of
1’s in the binary number).
• Thus, the parity flag in the flag register indicates if the most recent result of
the ALU operation is of even parity or odd parity.
• If it follows even parity, the P flag will be set to 1; else it remains zero.
5. Carry flag (CY):
• It occupies the 0th bit of the flag register.
• After the execution of arithmetic instruction, if a carry is produced(if result
is more than 8 bits), then the carry flag is set to 1 otherwise it is zero.
• The carry flag is set or reset in case of addition as well as subtraction
(CY=1, if borrow is produced)

20-09-2022 By: Atifa Aqueel 48


Examples
• Add CB AND F9
40+40=80
• 1100 1011 1000 0000
• 1110 1001 overflow
1 1011 0100
In case of signed magnitude representatiom
S Z AC P CY
With the help of 8 bit, the max no. is7F and min -7F
1 0 1 1 1
• Add 42 and 24

20-09-2022 By: Atifa Aqueel 49


Stack & Stack Pointer
• A stack is stated as the container of elements where insertion and removal
of the elements follow with the last-in-first-out (LIFO) theory.
• Here, the insertion of elements is done through push operation and removal
of elements is done through a pop operation.
• Also, the other definition in the technical aspect is, a stack is a LIFO data
structure which is employed in the RAM area where one can store
temporary data and addresses when the microprocessor jumps to a
subroutine from its current task.
• Then the retrieved address would be used by the processor to jump back to
the previous routine/job/task. A stack is also called a recursive data
structure where pushing and popping happens continuously.

20-09-2022 By: Atifa Aqueel 50


STACK

20-09-2022 By: Atifa Aqueel 51


Stack & Stack Pointer

20-09-2022 By: Atifa Aqueel 52


Stack & Stack Pointer

20-09-2022 By: Atifa Aqueel 53


Stack Pointer

20-09-2022 By: Atifa Aqueel 54


Question
Q: What do you understand by High Level
Language, Assembly Language as well as
Machine Language. Explain the function of
compiler and interpreter.

20-09-2022 By: Atifa Aqueel 55


8085 PIN DIAGRAM

20-09-2022 By: Atifa Aqueel 56


8085 PIN DIAGRAM

20-09-2022 By: Atifa Aqueel 57


Classification of 8085 pins

20-09-2022 By: Atifa Aqueel 58


8085 PIN Configuration
• Fig. 1.3 (a) and (b) shows 8085 Pin Diagram and functional
pin diagram of 8085 microprocessor respectively.
• This classification is done on the basis of the signal types into
6 groups as follows:
1. Address Bus (A15-A8)
2. Multiplexed Address Data Bus (AD7-AD0)
3. Control and Status Signals
4. Power Supply and frequency signals
5. Serial I/O ports
6. Interrupts and Externally Initiated signals

20-09-2022 By: Atifa Aqueel 59


Address Bus (A15-A8)
• The address bus is a group of sixteen lines i.e A0-A15.
• However these lines are split into two segments: A15-A8 and
AD7-AD0.
• Line A15-A8 are used to carry most significant 8 bits of the
memory or peripheral address.
• 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.

20-09-2022 By: Atifa Aqueel 60


Multiplexed Address Data Bus (AD7-AD0)

• The 8 bit data bus (D0 – D7) is multiplexed with the lower half
(A0 – A7) of the 16 bit address bus.
• These are time multiplexed Address/Data bus i.e. they serve
dual purpose.
• During first part of the machine cycle (T1), lower 8 bits of
memory address or I/O address appear on the bus.
• During remaining part of the machine cycle (T2 and T3) these
lines are used as a bi-directional data bus.
• However lower order address can be separated from the data
bus by using external latch.

20-09-2022 By: Atifa Aqueel 61


Control and Status Signals
• This group of signal includes two control signals ( ), three status
signals (IO/ S0 & S1) to identify the nature of operation and one special
signal (ALE) to indicate the beginning of operation.
• These signals are as follows:
• S1 and S0 (Status signals) – These are basic status signals that indicate the
operation that the microprocessor is performing at any given stage.

20-09-2022 By: Atifa Aqueel 62


Control Signals
• (Read) – This is an active low input. When it goes low, the
microprocessor reads data from either the IO device or from memory. In
simple terms, the microprocessor takes data input by placing the data from
a source (IO/Memory) on the data bus.
• (Write) – Another active low pin that does the opposite work as the
previous pin. When it goes low, the data on the data bus is written to a
memory location or an I/O device.
• IO/ : 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. This signal is combined with RD’ and WR’ to generate
IO and memory control signals.

20-09-2022 By: Atifa Aqueel 63


20-09-2022 By: Atifa Aqueel 64
ALE (Address Latch Enable)
• ALE (Address Latch Enable) : We, know that AD0 to AD7 lines are
multiplexed and the lower half of address (A0 – A7) is available only during
T1 of the machine cycle.
• This lower half of address is also necessary during T2 and T3 of machine
cycle to access specific location in memory or I/O port.
• This means that the lower half of an address must be latched in T1 of the
machine cycle, so that it is available throughout the machine cycle.
• The latching of lower half of an address bus is done by using external latch
and ALE signal from 8085 Pin Diagram

20-09-2022 By: Atifa Aqueel 65


ALE (Address Latch Enable)
• ALE is a positive going pulse generated when a new operation is started by
the microprocessor.
• A high signal on ALE indicates that the bits on AD7-AD0 are address bits,
whereas a low signal on ALE indicates that the bits on AD7-AD0 are data
bits.
• ALE signal is used primarily to latch a low order address from the
multiplexed bus and generate a separate set of 8 address lines A7-A0.

20-09-2022 By: Atifa Aqueel 66


Power Supply and Frequency signals
• The power supply and frequency signals of Intel 8085 are:
• Vcc : It requires a single +5 V power supply.
• Vss or Gnd: Ground reference.
• X1 and X2 : A tuned circuit like LC, RC or crystal is connected at these two
The internal clock generator divides oscillator frequency by 2, therefore, to
operate a system at 3 MHz, the crystal of tuned circuit must have a
frequency of 6 MHz.
• CLK OUT : This signal is used as a system clock for other devices
(Peripherals).
• Its frequency is half the oscillator frequency.
• This pin is used to synchronize all the peripherals with the microprocessor.
• The frequency available here is the same as the frequency that the
microprocessor clock generator generates.

20-09-2022 By: Atifa Aqueel 67


Serial IO Ports
• 8085 has two signals to implement the serial transmission. These are SID
and SOD lines. In serial transmission data are sent over a single line one bit
at a time, such as transmission over telephone lines.
• SID (Serial Input Data) – This pins accepts serial input data.
• The microprocessor receives data bit by bit through this pin.
• The data transfers from the pin to the 7th bit of the accumulator when a
RIM instruction executes.

• SOD (Serial Output Data) – It is a data line for serial output transmission.
• This pin outputs serial data onto the 7th bit of the accumulator when a SIM
instruction is executed.
• The microprocessor sends out data bit by bit through this pin.
• RIM and SIM are two instructions used for serial transmission.

20-09-2022 By: Atifa Aqueel 68


Interrupts and Externally Initiated
Signals
• The 8085 Pin Diagram has five hardware interrupt signals that can be used to
interrupt a program execution:
• (i) INTR
(ii) RST 7.5
(iii) RST 6.5
(iv) RST 5.5
(v) TRAP
• The microprocessor acknowledges Interrupt Request by 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.

20-09-2022 By: Atifa Aqueel 69


INTR and INTA’

• INTR (Interrupt Request) – Other interrupts, the ones above, actually


interrupt the normal functioning of the microprocessor. However, INTR,
which has the lowest priority, executes on the completion of the current
program. Once the interrupt signal from INTR is acknowledged, the INTA
signal is issued.

20-09-2022 By: Atifa Aqueel 70


TRAP, RST 7.5, RST 6.5, RST 5.5

vectored

20-09-2022 By: Atifa Aqueel 71


• TRAP, RST 7.5, RST 6.5, RST 5.5 –The interrupt is used to transfer data from
peripherals.
• A different program stored in a different location starts executing once a signal is
given to any of these pins.
• However, these can be masked using code.
• Check out the table below for the priority of these interrupts.
• If two simultaneous interrupts are received, the microprocessor executes them
according to this priority level.

20-09-2022 By: Atifa Aqueel 72


RESET Signals
• – The bar on top of the pin indicates that this is an active low
pin. Which means that it is active when it is given a low (zero) input. When
a high (one) input is given, it’s off. The function of this pin is to reset the
microprocessor. The program counter (which increases as programs
execute) sets to 0. A fresh start. Once the low input is removed, the
microprocessor begins executing instructions from 0000H address. The
state of the flags and internal registers is unpredictable on the application of
this signal.
• RESET OUT – This signal is used to
• a) indicate that the microprocessor is being reset.
• b) Reset external peripherals connected to the microprocessor.

20-09-2022 By: Atifa Aqueel 73


HOLD, HLDA and READY

20-09-2022 By: Atifa Aqueel 74


DMA (Direct Memory Access)
Signals (Pins HOLD and HLDA)

20-09-2022 By: Atifa Aqueel 75


DMA (Direct Memory Access)
Signals (Pins HOLD and HLDA)
• HOLD – The HOLD pin can be used to communicate to the
microprocessor control mechanism that an external device is requesting the
use of the address and data bus. Suppose a shift register IC is using the
address and the data bus at a particular instant. Suddenly, a
wild Counter appears and sends a signal to the HOLD pin. The
microprocessor says hang on! Let me finish my current machine cycle.
Once the microprocessor does that, it gives up control of the buses to the
counter. And send out an acknowledge signal via the HLDA pin.
• HLDA (HOLD Acknowledge) – The HOLD Acknowledge pin goes high
when the microprocessor surrenders its control of the buses in response to
the HOLD call. Once the HOLD request is attended to, the HLDA pin goes
low, and the processor takes over the buses.

20-09-2022 By: Atifa Aqueel 76

You might also like