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

Lecture - 2

Uploaded by

Groot Groot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture - 2

Uploaded by

Groot Groot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

THE INTEL 8085 MICROPROCESSOR

LECTURE - 2

Abdullah Al Noman
Lecturer
Computer Science and Engineering Department
Shahjalal University of Science and Technology
The Intel 8085 Microprocessor
INTEL 8085 MICROPROCESSOR

o This is an 8-bit microprocessor. Why it is called an 8-bit microprocessor?


• Because its data bus is 8-bit.
• What is a bus?
• Simply put, the bus is the connector that connects the microprocessor with
memory, external, and internal resources.
o Intel introduced this in 1977.
o This is the modified version of 8080.
o Two new instructions are added in this version.
• SIM – set interrupt mask
• RIM – read interrupt mask
• What is an interrupt?
• an interrupt is a signal that temporarily suspends the normal execution of a
program and redirects the control to a specific interrupt service routine
(ISR).
INTEL 8085 MICROPROCESSOR

o Predecessor of 8086.
o It is a 40-pin integrated circuit.
o Its operating frequencies are 3,5, and 6 MHz.
• Operating frequency of 8085-A is 3 MHz.
𝑓 = 3 × 106 𝐻𝑍
1 1 10−6 10−6 1000 −9 = 333𝑛𝑠
𝑆𝑜, 𝑇 = = = = ∗ = 333 × 10
𝑓 3 ∗ 106 3 3 1000
• So, 1 Time period of 8085 is = 333ns. What does it mean?

o 8085 uses a single +5-volt (V) power supply.


o It has 16 bit address bus.
• That means it can relate 216 unique addresses.
INTEL 8085 MICROPROCESSOR

o To uniquely identify 8-byte memory, what is the required address bus size?
INTEL 8085 MICROPROCESSOR

o 8085 can access 216 𝑏𝑦𝑡𝑒𝑠 of memory. Where, 216 = 26 × 210 = 26 × 1𝐾𝐵 = 64 𝐾𝐵

o So, 8085 can attach 64KB of memory.

o How much memory (RAM) can be attached to a microprocessor with a 20-bit address
bus?
PIN Diagram of 8085
(External Architecture)
PIN DIAGRAM OF 8085 MICROPROCESSOR

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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

Control and Status Signals


ALE – It is an Address Latch Enable signal. It goes
high during the first T state of a machine cycle and
enables the lower 8-bits of the address if its value is
1. Otherwise, the data bus is activated.
ALE = 1, Address bus enabled
ALE = 0, data bus enabled

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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

Control and Status Signals


SO, S1 – These are status signals. They distinguish
the various types of operations such as halt, reading,
instruction fetching or writing.
PIN DIAGRAM OF 8085 MICROPROCESSOR

Control and Status Signals


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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

Interrupts and Peripheral Initiated Signals


The 8085 has five 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 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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

Interrupts and Peripheral Initiated Signals


INTR – It is an interrupt request signal.

INTA’ – It is an interrupt acknowledgement sent by


the microprocessor after INTR is received.
PIN DIAGRAM OF 8085 MICROPROCESSOR

Reset Signals
RESET IN’ – When the signal on this pin is low(0),
the program-counter is set to zero, the buses are
tristated 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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

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.
PIN DIAGRAM OF 8085 MICROPROCESSOR

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.
Internal Architecture of 8085
Microprocessor
INTERNAL ARCHITECTURE OF 8085 MICROPROCESSOR
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

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
FLAG REGISTER
Flag bits become set (1) or reset (0) depending on the value of the outcome of any
arithmetic and logical operation. Only five of the eight bits in the flag register of the
8085 microprocessor's register are actually used. The 5 flags are:

Sign Flag (S) - After any operation if the MSB (B(7)) of the result is 1, it indicates the
number is negative and the sign flag becomes set, i.e. 1. If the MSB is 0, it indicates the
number is positive and the sign flag becomes reset i.e. 0.
00110000 30H
subtraction 01000000 40H
1 11110000 -AH
-10H
FLAG REGISTER

Zero Flag (Z) – After any arithmetical or logical operation if the result is 0 (00)H, the
zero flag becomes set i.e. 1, otherwise it becomes reset i.e. 0.

00110000 30H
subtraction 00110000 30H
00000000 00H
FLAG REGISTER

Auxiliary Carry Flag (AC) – This flag is used in the BCD number system(0-9). If after
any arithmetic or logical operation D(3) generates any carry and passes it on to D(4) this
flag becomes set i.e. 1, otherwise, it becomes reset i.e. 0.
00101011 2BH
addition 00111001 39H
01100100 64H
FLAG REGISTER

Parity Flag (P) – If after any arithmetic or logical operation the result has even parity,
an even number of 1 bit, the parity register becomes set i.e. 1, otherwise it becomes reset
i.e. 0.
00110000 30H
addition 00110000 30H
01100000 60H
FLAG REGISTER

Carry Flag (CY) – Carry is generated when performing n bit operations and the result
is more than n bits, then this flag becomes set i.e. 1, otherwise, it becomes reset i.e. 0.

00110000 30H
subtraction 01000000 40H
1 11110000 -AH

Carry
ACCUMULATOR

Accumulator is used to perform I/O,


arithmetic, and logical operations. It is
connected to ALU and the internal data
bus.
GENERAL PURPOSE REGISTERS

These registers work as 16-bit registers


when they work in pairs like B-C, D-E,
and H-L.
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.
PROGRAM COUNTER

int a,b,c;
a = 10; I1: MOV A, 0AH 1000
b = 20, I2: MOV B, 14H 1001
c = a+b; I3: ADD B 1002
C Program Assembly code Memory Location

• The PC normally contains the address of the next instruction to be


executed.
• After fetching each instruction, the value of PC increments by +1

For Example: Suppose current value of Program Counter : [PC] = 1000H


(It means that next executing instruction is at location 1000H. After fetching, program Counter(PC) always increments
by +1 for fetching of next instruction.)
STACK POINTER

It reserves the address of the most recent


stack entry (top of the stack). 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

STACK PUSH
STACK POINTER

STACK POP
STACK POINTER

How stack works in 8085 while nested call request?

What is the difference between PC and SP?


TEMPORARY REGISTER

It is an 8-bit register that holds data


values during arithmetic and logical
operations.
INSTRUCTION REGISTER

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

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.
TIMING AND CONTROL UNIT

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 address bus is unidirectional whereas the data bus is bidirectional. The Address bus
is used to transfer the memory address of the data that needs to be read or written. The
Data bus is used to transfer data between the microprocessor and external devices such
as memory and I/O devices. The data bus can also be used for instruction fetch
operations, where the microprocessor fetches the instruction code from memory and
decodes it.
SERIAL INPUT/OUTPUT CONTROL

It controls the serial data communication between the


microprocessor and external devices by using Serial input data
pin and Serial output data pin in a serial manner, i.e., one bit at a
time. 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.
Addressing modes of 8085
Microprocessor
ADDRESSING MODES OF 8085 MICROPROCESSOR

o Addressing modes are techniques used in computer architecture and assembly language
programming to specify how the operands of an instruction are located or accessed in
memory. In other words, addressing modes define the way in which the CPU calculates
the effective address of an operand before performing an operation.

o In 8085 microprocessor there are 5 types of addressing modes:


• Immediate Addressing Mode
• Register Addressing Mode
• Direct Addressing Mode
• Register Indirect Addressing Mode
• Implied/Implicit Addressing Mode
ADDRESSING MODES OF 8085 MICROPROCESSOR

o 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)
ADDRESSING MODES OF 8085 MICROPROCESSOR

o 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)
ADDRESSING MODES OF 8085 MICROPROCESSOR

o 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)
ADDRESSING MODES OF 8085 MICROPROCESSOR

o 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)
ADDRESSING MODES OF 8085 MICROPROCESSOR

o 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)
The flow of an Instruction Cycle
in 8085 Architecture
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.
THE FLOW OF AN INSTRUCTION CYCLE IN 8085 ARCHITECTURE

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.
Timing diagram of MOV
Instruction for 8085 µP
TIMING DIAGRAM OF MOV INSTRUCTION

o Timing diagram of “MOV B,C” instruction in 8085

Only opcode fetching is required for this instruction. Here the opcode for
the “MOV B,C” instruction is 41H.
TIMING DIAGRAM OF MOV INSTRUCTION

o Timing diagram of MOV B,C instruction in 8085


THANK YOU

You might also like