Document From Pratheesh
Document From Pratheesh
(Autonomous Institution)
COIMBATORE – 641 004
A report submitted in partial fulfilment of the requirements for the course
RAGUL S (23U235)
II YEAR (IV SEMESTER)
1
PSG COLLEGE OF TECHNOLOGY
COIMBATORE – 641 004
(Government aided autonomous college affiliated to Anna university, Chennai)
A REPORT
SUBMITTED BY
RAGUL S (23U235)
II YEAR B.E. ICE
2
Table of Contents
SECTION PAGE NO
List of Figures 5
List of Tables 5
1. Introduction 6
2.1 Objective 23
2.3 Theory 23
3
2.4 Algorithm 24
2.5 Flowchart 25
2.7 Calculation 28
2.9 Inference 29
2.10 Conclusion 30
References 31
4
LIST OF FIGURES
2.1 Flowchart 25
LIST OF TABLES
5
CHAPTER 1
INTRODUCTION
1.1 DEFINITION OF MICROPROCESSSOR
Microprocessor is a multipurpose or general-purpose, register-based, clock-based, even-based,
semiconducting electronic IC, which accepts digital data as input, processes the data according
to the instructions stored in the memory, and provides result as output. 8085 is an 8-bit
microprocessor as it operates on 8 bits at a time and is created with N-MOS technology. The
size of the data bus of 8085 is 8 bits while that of the address bus is 16. Therefore, can
address 64 KB (i.e.216) memory. Also, as it can perform 8-bit operation thus the size of ALU is
also 8-bit. and operates at 3.2 MHz single segment CLK. The applications of 8085
microprocessor are involved in microwave ovens, washing machines, gadgets, etc
1.2 INTRODUCTION TO 8085 MICROPROCESSSOR
Developed by Intel Corporation in the late 1970s, the 8085 microprocessor revolutionized the
field, paving the way for countless advancements in technology. In this article, we delve into
the architecture, features, and impact of the 8085 microprocessor, showcasing important points
such as 8085 microprocessor architecture, 8085 microprocessor pin diagram, 8085
microprocessor instruction set, functional unit and more. The 8085 microprocessor is an 8-bit
microprocessor that was introduced by Intel in 1976. It is part of the 8085 family of
microprocessors, which includes the 8080, 8085A, and other variants. The 8085
microprocessor became very popular and widely used in various applications, including
personal computers, embedded systems, industrial control systems, and more. It has the
following configuration:
• 8-bit data bus
• 16-bit address bus, which can address upto 64KB
• A 16-bit program counter
• A 16-bit stack pointer
• Six 8-bit registers arranged in pairs: BC, DE, HL
• Requires +5V supply to operate at 3.2 MHZ single phase clock.
6
Address & Data Bus Multiplexed: In the 8085, the data bus (D0 – D7) and lower 8-
bit address bus (A0 – A7) are multiplexed in order to reduce the number of external
pins. However, as a result, address lines and data lines must be separated by additional
hardware (Latch).
Single +5V Power Supply: The 8085 microprocessor operates on a single +5V power
supply, making it suitable for low-power applications. Power supply is connected to
Vdd and Ground is connected to Vss.
Clock Frequency: The 8085 typically operates at a clock frequency of 3 MHz. 8085A-
2 version can operate at a maximum frequency of 5 MHz. It functions on a 50% duty
cycle clock cycle.
Clock Generator: It has on chip clock generator. This internal clock generator requires
a calibrated LC, RC, or crystal circuit. The internal clock generator generates clock
signal by dividing oscillator frequency by two.
Registers: It has six general-purpose registers, these are register B, C, D, E, H, and L,
which can be used individually (as 8-bit) or in pairs (as 16-bit) to perform various
arithmetic and logical operations.
Accumulator: The accumulator (A register) is a special 8-bit register used for
arithmetic and logic operations. Most arithmetic operations involve the accumulator.
Flag Register: The flag register consists of various flags that are set or reset based on
the result of the previous operation. The flags include Carry (CY), Auxiliary Carry
(AC), Sign (S), Zero (Z), Parity (P), and Overflow (V).
Stack Pointer (SP): The 8085 has a 16-bit stack pointer, which points to the memory
location where the stack is currently located. The stack is used for storing return
addresses and local data during subroutine calls.
Program Counter (PC): The program counter is a 16-bit register that holds the
memory address of the next instruction to be executed.
Instruction Set: The 8085 microprocessor supports 246 instructions, including
arithmetic operations (addition, subtraction, etc.), logical operations (AND, OR, XOR),
data transfer operations, branching instructions, and more.
Interrupts: The 8085 supports five hardware interrupts, these are TRAP, RST 7.5, RST
6.5, RST 5.5, and INTR. These interrupt lines allow external devices to request attention
from the microprocessor.
Serial Input/Output Ports: The 8085 has two serial I/O ports (SID and SOD) for serial
communication with peripherals like keyboards, displays, and other devices.
Control Signal: It provides control signals (IO/M(low), RD(low), WR(low)) to control
the bus cycle, and hence external bus controller is not required.
DMA Controller: The 8085 is capable of sharing the system interface with Direct
Memory Access controller. This feature permits the transmission of large amounts of
data at high velocities from I/O devices to memory or from I/O devices.
7
1.4 ARCHITECTURE OF 8085 MICROPROCESSSOR
8
Figure 1.2 Flag Registers
In an arithmetic process, whenever a carry is produced with the lesser nibble, then an auxiliary
type carry flag will be set. After an ALU operation, when the outcome has an even number then
the parity flag will be set, or else it is reset. When an arithmetic process outcome in a carry,
then carry flag will be set or else it will be reset. Between the five types of flags, the AC type
flag is employed on the inside intended for BCD arithmetic as well as remaining four flags are
used with the developer to make sure the conditions of the outcome of a process.
Control and Timing Unit:
The control and timing unit coordinates with all the actions of the microprocessor by the clock
and gives the control signals which are required for communication among the microprocessor
as well as peripherals.
Register Array:
The general purpose programmable registers are classified into several types apart from the
accumulator such as B, C, D, E, H, & L. These are utilized as 8-bit registers otherwise coupled
to stock up the l6 bit of data. The permitted couples are BC, DE & HL registers are used in the
processor & it cannot be utilized with the developer.
Decoder and Instruction Register:
As an order is obtained from memory after that it is located in the instruction register, and
encoded & decoded into different device cycles.
Special Purpose Registers:
These registers are classified into four types namely program counter, stack pointer, increment
or decrement register, address buffer, or data buffer.
Program Counter:
This is the first type of special-purpose register and considers that the instruction is being
performed by the microprocessor. When the ALU completed performing the instruction, then
the microprocessor searches for other instructions to be performed. Thus, there will be a
requirement of holding the next instruction address to be performed in order to conserve time.
Microprocessor increases the program when an instruction is being performed, therefore that
the program counter-position to the next instruction memory address is going to be performed.
Stack Pointer in 8085:
The SP or stack pointer is a 16-bit register and functions similar to a stack, which is constantly
increased or decreased with two throughout the push and pop processes.
9
Increment or Decrement Register:
The 8-bit register contents or else a memory position can be increased or decreased with one.
The 16-bit register is useful for incrementing or decrementing program counters as well as
stack pointer register content with one. This operation can be performed on any memory
position or any kind of register.
Address-Buffer & Address-Data-Buffer:
Address buffer stores the copied information from the memory for the execution. The memory
& I/O chips are associated with these buses; then the CPU can replace the preferred data by
I/O chips and the memory.
Address Bus and Data Bus:
The data bus is useful in carrying the related information that is to be stock up. It is bi-
directional, but the address bus indicates the position as to where it must be stored & it is uni-
directional, useful for transmitting the information as well as address input/output devices.
Timing & Control Unit:
The timing & control unit can be used to supply the signal to the 8085 microprocessor
architecture for achieving the particular processes. The timing and control units are used to
control the internal as well as external circuits. These are classified into four types namely
control units like RD ALE, READY, WR, status units like S0, S1, and IO/M , DM like HLDA,
and HOLD unit, RESET units like RST-IN and RST-OUT.
10
The 8085 microprocessor pin diagram provides a visual representation of the connections and
functionalities of the different pins on the 8085 microprocessor.
Data Bus
The pins from 12 to 17 are the data bus pins which are AD0 – AD7, this carries the minimal
considerable 8-bit data and address bus.
Address Bus
The pins from 21 to 28 are the data bus pins which are A8 – A15, this carries the most
considerable 8-bit data and address bus.
Status and the Control Signals
In order to find out the behaviour of the operation, these signals are mainly considered. In the
8085 devices, there are 3 each the control and status signals.
RD :
This is the signal used for the regulation of READ operation. When the pin moves into low, it
signifies that the chosen memory is read.
WR:
This is the signal used for the regulation of WRITE operation. When the pin moves into low, it
signifies that the data bus information is written to the chosen memory location.
ALE :
ALE corresponds to Address Latch Enable signal. The ALE signal is high at the time of the
machine’s initial clock cycle and this enables the last 8 bits of the address to get latched with
the memory or external latch.
IO/M :
This is the status signal that recognizes whether the address to be allotted for I/O or for memory
devices.
READY :
This pin is used to specify whether the peripheral is able to transfer information or not. When
this pin is high, it transfers data and if this is low, the microprocessor device needs to wait until
the pin goes to a high state.
CLOCK SIGNALS:
CLK – This is the output signal which is pin 37. This is utilized even in other digital integrated
circuits. The frequency of the clock signal is similar to the processor frequency.
X1 and X2 – These are the input signals at pins 1 and 2. These pins have connections with the
external oscillator that operates the device’s internal circuitry system. These pins are used for
the generation of the clock that is required for the microprocessor functionality.
11
RESET SIGNALS:
There are two reset pins which are Reset In and Reset Out at pins 3 and 36.
RESET IN:
This pin signifies resetting the program counter to zero. Also, this pin resets the HLDA flip-
flops and IE pins. The control processing unit will be in a reset state till RESET is not triggered.
RESET OUT:
This pin signifies that the CPU is in reset condition.
SERIAL INPUTS /OUTPUT SIGNALS:
SID :
This is the serial input data line signal. The information that is on this dateline is taken into the
7th bit of the ACC when the RIM functionality is performed.
SOD :
This is the serial output data line signal. The ACC’s 7th bit is the output on the SOD data line
when the SIIM functionality is performed.
EXTERNALLY INITIATED AND INTERRUPT SIGNALS:
HLDA :
This is the signal for HOLD acknowledgment that signifies the received signal of HOLD
request. When the request is removed, the pin goes to a low state. This is the output pin.
HOLD :
This pin indicates that the other device is in the need to utilize data and address buses. This is
the input pin.
INTA:
This pin is the interrupt acknowledgment that is directed by the microprocessor device after
the receival of the INTR pin. This is the output pin.
INTR:
This is the interrupt request signal. It has minimal priority when compared with other interrupt
signals.
The priority list of these interrupt signals is,
• TRAP – Highest
• RST 7.5 – High
• RST 6.5 – Medium
• RST 5.5 – Low
• INTR – Lowest
12
1.6 SIGNAL DIAGRAM OF 8085 MICROPROCESSSOR
13
Figure 1.6 Programmers Model of 8085
Here, the information which has to be operated is present in the registers and the operands are
the registers. So, the operation takes place inside multiple registers of the microprocessor.
Here, the information which has to be operated is present in the memory location, and the
operand is directly considered as the memory location.
14
• IN 35 – It implies reading of the information from the port that has address 35.
Here, the information which has to be operated is present in the memory location, and the
operand is indirectly considered as the register pair.
Here, the operand is concealed and the information that has to be operated is present in the
data itself.
• RRC – Implies of rotating accumulator A to the right position by one bit.
• RLC – Implies of rotating accumulator A to left position by one bit.
2. Arithmetic Instructions
These instructions are used for performing arithmetic operations like addition, subtraction,
and
incrementing values.
• ADD: Add contents of a register or memory to the accumulator.
• ADI: Add immediate data to the accumulator.
• SUB: Subtract contents of a register or memory from the accumulator.
• SUI: Subtract immediate data from the accumulator.
• INR: Increment the contents of a register or memory by 1.
• DCR: Decrement the contents of a register or memory by 1.
.
15
3. Logical Instructions
These instructions are used for logical operations such as AND, OR, XOR, etc.
• ANA: AND the contents of a register or memory with the accumulator.
• ANI: AND immediate data with the accumulator.
• XRA: XOR the contents of a register or memory with the accumulator.
• XRI: XOR immediate data with the accumulator.
• ORA: OR the contents of a register or memory with the accumulator.
• ORI: OR immediate data with the accumulator.
• CPI: Compare the accumulator with immediate data.
• RLC: Rotate the accumulator left through the carry.
• RRC: Rotate the accumulator right through the carry.
5. Control Instructions
These are instructions used to control the internal state of the microprocessor.
• NOP: No operation
• HLT: Halt the execution of the program.
16
17
• JPO addr (label) (Jump if odd parity)
18
13. RIM (Read Interrupt Masks)
14. NOP (No Operation)
19
1.11 LIST OF IC’S IN 8085 TRAINER KIT AND ITS FUNCTIONS
1. Microprocessor IC
2. Memory ICs
3. Peripheral ICs
• IC 8279 (Keyboard and Display Controller) – Handles keyboard scanning and display
output.
• IC 8237 (DMA Controller - Optional) – Manages direct memory access for faster data
transfer.
• IC 74373 (Octal Latch) – Holds address information and separates address/data bus.
20
• IC 7404 (Hex Inverter) – Used in clock and reset signal circuits.
21
• After entering the program, verify the instructions.
Step 4: Executing the Program :
• Set the Program Counter (PC) to the starting address (e.g., 2000H).
• Press RUN/EXECUTE to start execution.
• Observe the results on:
o Display/LEDs (if output is mapped to a display).
o Memory locations (using the memory inspect feature).
Step 5: Debugging & Modifying the Program :
• Use the Single Step Mode to execute one instruction at a time.
• Inspect the registers and memory contents for debugging.
• Modify instructions if necessary using the keypad.
Step 6: Storing and Reloading a Program :
• If the trainer kit supports EEPROM or External Storage, you can save and reload your
program.
• Some kits allow communication via serial ports (RS-232) to upload programs from a
PC.
Step 7: Powering OFF the Kit :
• Ensure no program is running.
• Power OFF the trainer kit properly.
• Disconnect external components if required.
22
CHAPTER 2
COMULTIPLICATION OF TWO 16-BIT NUMBER
USING 8085 MICRO PROCESSOR
2.1 OBJECTIVE
To write an assembly language multiplication of two 16-bit numbers using
8085 Simulator.
1. Jubin Mitra 8085 Simulator – Used for writing, assembling, and debugging the
8085 assembly code.
2. Assembler – Converts assembly language into machine code.
3. Debugger/Emulator – For verifying and troubleshooting program execution.
2.3 THEORY
Introduction
The 8085 microprocessor, being an 8-bit processor, performs 16-bit multiplication using
multiple steps. Since it lacks a direct multiplication instruction, the process is done using
repeated addition or the shift-and-add method. The 16-bit numbers are divided into 8-bit parts,
and partial products are generated and summed to obtain a 32-bit result. The final product is
stored in memory as lower and upper 16-bit parts.
23
3. The 16-bit numbers are divided into lower and upper 8-bit parts for processing.
5. These partial products are properly shifted and added to form the final 32-bit result.
6. Since 8085 lacks a direct multiplication instruction, repeated addition or the shift-and-add method
is used.
7. The final 32-bit product is stored in memory, with the lower and upper 16-bit parts kept separately.
25
2.6 ASSEMBLY LANGUAGE PROGRAM
26
This algorithm multiplies two 16-bit numbers stored in memory locations
8000H and 8002H, using repeated addition.
27
2.7 CALCULATION
Since there is no carry, the upper result (stored at 8052H) remains 0000H.
INPUT 1 8000 24
INPUT 2 8001 1C
INPUT 3 8002 52
OUTPUT 1 88
8050
OUTPUT 2 8051 FF
OUTPUT 3 8052 CD
28
2.9 INFERENCE
tMultiplication of two 16-bit numbers using the 8085 microprocessor requires breaking the
operation into smaller steps since the 8085 does not have a built-in multiplication instruction.
Instead, the multiplication is performed using a combination of successive addition, shift-and-
add techniques, or repeated calls to an 8-bit multiplication routine.
To begin with, the two 16-bit numbers are stored in memory or registers. Each number is then
divided into two 8-bit parts: the lower byte and the higher byte. This allows the multiplication
to be carried out in multiple steps. The process starts with multiplying the lower bytes of both
numbers, which gives the least significant part of the result. Next, crosswise multiplication is
performed between the higher byte of the first number and the lower byte of the second
number, and vice versa. These partial products are shifted left by 8 bits before being added to
the previous result. Finally, the higher bytes of both numbers are multiplied, and this result is
shifted left by 16 bits before being added to obtain the final 32-bit product.
Since the 8085 microprocessor can only handle 8-bit operations, an 8-bit multiplication
subroutine is used repeatedly to perform these steps. This subroutine typically employs
successive addition, where one operand is added repeatedly to itself as many times as
specified by the other operand, or it may use a look-up table for optimization. The
intermediate results are carefully managed to avoid overflow and ensure correct alignment
within the 32-bit product.
Once all partial products are computed and summed, the final result is stored in consecutive
memory locations. This ensures that it can be used for further processing or displayed as
needed. Despite the lack of direct multiplication support, this method allows the 8085 to
effectively multiply two 16-bit numbers with accuracy.
29
2.10 CONCLUSION
30
REFRENCES
31