Lecture - 2
Lecture - 2
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 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 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 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
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.
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.
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
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
STACK PUSH
STACK POINTER
STACK POP
STACK POINTER
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
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.
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
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
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
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
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
Only opcode fetching is required for this instruction. Here the opcode for
the “MOV B,C” instruction is 41H.
TIMING DIAGRAM OF MOV INSTRUCTION