Microprocessor
Microprocessor
IV - SEMESTER
V CONVERSIONS 71
Page 2 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
UNIT- I
MICROPROCESSORS, MICROCOMPUTER AND ASSEMBLY LANGUAGE
Microprocessor
A Microprocessor is a multipurpose programmable, clock driven, register based
electronic device that reads binary instructions from a storage device called memory, accepts
binary data as input, processes data according to those instructions and provide result s as
output.
The microprocessor operates in binary 0 and 1 known as bits are represented in terms
of electrical voltages in the machine that means 0 represents low voltage level and 1 represents
high voltage level.
Each microprocessor recognizes and processes a group of bits called the word and
microprocessors are classified according to their word length such as 8 bits microprocessor
with 8 bit word and 32 bit microprocessor with 32 bit word etc.
Page 3 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
depending on the sequence of instructions supplied in the given program. By changing the
program, the microprocessor manipulates the data in different ways.
Instructions:
Each microprocessor is designed to execute a specific group of operations. This group
of operations is called an instruction set. This instruction set defines what the microprocessor
can and cannot.
A Microprocessor as a CPU:
Traditionally, the computer is represented with four components such as memory,
input, output and central processing unit (CPU) which consists of arithmetic logic unit (ALU)
and control unit (CU).
The CPU contains various registers to store data, the ALU to perform arithmetic and
logical operations, instruction decoders, counters and control lines.
The CPU reads instructions from memory and performs the tasks specified. It
communicates with input/output (I/O) devices either to accept or to send data, the I/O devices
is known as peripherals.
Later on around late 1960’s, traditional block diagram can be replaced with computer
having microprocessor as CPU which is known as microcomputer. Here CPU was designed
using integrated circuit technology (IC’s) which provided the possibility to build the CPU on
a single chip.
Page 4 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 5 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Microprocessor:
It is clock driven semiconductor device consisting of electronic logic circuits
manufactured by using either a large scale integration (LSI) or very large scale integration
(VLSI) technique. It is capable of performing various computing functions and making
decisions to change the sequence of program execution. It can be divided in to three segments.
Arithmetic/Logic unit: It performs arithmetic operations as addition and subtraction and
logic operations as AND, OR & XOR.
Register Array: The registers are primarily used to store data temporarily during the
execution of a program and are accessible to the user through instruction. The registers
can be identified by letters such as B, C, D, E, H and L.
Control Unit: It 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
& peripherals.
Memory:
Memory stores binary information such as instructions and data, and provides that
information to the up whenever necessary. To execute programs, the microprocessor reads
instructions and data from memory and performs the computing operations in its ALU. Results
are either transferred to the output section for display or stored in memory for later use.
Memory has two sections.
A. Read only Memory (ROM): Used to store programs that do not need alterations and can
only read.
B. Read/Write Memory (RAM): Also known as user memory which is used to store user
programs and data. The information stored in this memory can be easily read and altered.
Input/Output:
It communicates with the outside world using two devices input and output which are
also Known as peripherals.
The input device such as keyboard, switches, and analog to digital converter transfer
binary information from outside world to the microprocessor.
The output devices transfer data from the microprocessor to the outside world. They
include the devices such as LED, CRT, digital to analog converter, printer etc.
System Bus:
It is a communication path between the microprocessor and peripherals; it is nothing
but a group of wires to carry bits.
Page 6 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 7 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
ASCII Code
Assembler
High-Level Languages
Page 8 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Operating Systems
Different types of computers are designed to serve different purposes. Some are
suitable for scientific calculations, while others are used simply for tuning appliances on and
off. Until the 1970s computers were broadly classified in three categories: mainframe, mini,
and microcomputers.
Page 9 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Large Computers
These are large, general purpose, multiuser, multitasking, computers designed to
perform such data processing tasks as complex scientific and engineering calculations and
handling of records for large corporations or government agencies. These computers can be
broadly classified into mainframes and supercomputers, and mainframes are further classified
according to their sizes. Typical examples are IBM System/390 series, Cray computers (Cray-
2, Y-MP), the Fujitsu GS8800, and the Hitachi MP5800. Mainframes are high-speed
computers, and their word length generally ranges from 32 to 64 bits. Supercomputers such as
the Cray-2 and Y-MP are 64 bits high performance and high-speed computers.
Medium-size Computers
In the 1960s, these computers were designed to meet the instructional needs of small
colleges, the manufacturing problems of small factories and the data processing tasks of
medium-size business such as payroll and accounting. These are called mini-computers. These
machines were slower and smaller in memory capacity than mainframes.
Microcomputers
The 4-bit and 8-bit microprocessors became available in the mid-1970s, and initial
applications were primarily in the areas of machine control and instrumentation. As the price
of the microprocessors and memory began to decline, the applications mushroomed in almost
all areas, such as video games, word processing, and small-business applications. Early
microcomputers were designed around 8 bit microprocessors. Since then 16, 32, 64 bits
microprocessors, such as Intel 8086/88, Pentium I to IV, Motorola 68000, and the power PC
series have been introduced, and recent micro computers are designed around these
microprocessors. Present day micro computers can be classified in 4 groups: personal (or
business) computers (PC), work stations, single board, and single chip microcomputers
(microcontrollers).
Personal computers (PC)
These microcomputers are single user system and are used for a variety of purposes,
such as payroll, business accounts, word processing, legal and medical record keeping,
accessing Internet resources (email, Web search). They are also known as personal computers
(PC). The HP Pavilion series, Apple Macintosh series, DELL series, etc. A typical
configuration of the microcomputer spectrum includes a 32/64 bit microprocessor, 256MB-
1GB of system memory (RAM), a monitor, a hard disk with storage capacity more than 80 GB,
a CD-ROM drive.
Single-Board Microcomputers
Page 10 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 11 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 12 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 13 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
is going to be executed.
Stack pointer: It is also a 16-bit register works like stack, which is always
incremented/decremented by 2 during push & pop operations.
Temporary register: It is an 8-bit register, which holds the temporary data of arithmetic
and logical operations.
Flag register
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending
upon the result stored in the accumulator.
These are the set of 5 flip-flops −
Sign (S)
Zero (Z)
Auxiliary Carry (AC)
Parity (P)
Carry (C)
Its bit position is shown in the following table −
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
Sign Flag (S): Sets or Resets based on the result stored in the accumulator. If the result
stored is positive, the flag resets else if the result stored is negative the flag is set.
Zero Flag (Z): Sets or Resets based on the result stored in the accumulator. If the result
stored is zero the flag is set else it is reset.
Auxiliary Carry Flag (AC): This flag is set if there is a carry from low nibble (lowest
4 bits) to high nibble (upper 4 bits) or a borrow from high nibble to low nibble, in the
low order 8-bit portion of an addition or subtraction operation.
Instruction Classification
An instruction is a binary pattern designed inside a microprocessor to perform a
specific function. The entire group of instructions, called the instruction set, determines what
functions the microprocessor can perform. These instructions can be classified into the
following five functional categories: data transfer (copy) operations, arithmetic operations,
logical operations, branching operations, and machine-control operations.
Page 14 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Types Examples
Specific data byte to a register or a memory Load register B with the data byte 32H.
location.
Arithmetic Operations
These instructions perform arithmetic operations such as addition, subtraction, increment, and
decrement.
Addition - Any 8-bit number, or the contents of a register or the contents of a memory location
can be added to the contents of the accumulator and the sum is stored in the accumulator. No
two other 8-bit registers can be added directly (e.g., the contents of register B cannot be added
directly to the contents of the register C). The instruction DAD is an exception; it adds 16-bit
data directly in register pairs.
Subtraction - Any 8-bit number, or the contents of a register, or the contents of a memory
location can be subtracted from the contents of the accumulator and the results stored in the
accumulator. The subtraction is performed in 2's compliment, and the results if negative, are
expressed in 2's complement. No two other registers can be subtracted directly.
Increment/Decrement - The 8-bit contents of a register or a memory location can be
incremented or decrement by 1. Similarly, the 16-bit contents of a register pair (such as BC)
can be incremented or decrement by 1. These increment and decrement operations differ from
addition and subtraction in an important way; i.e., they can be performed in any one of the
registers or in a memory location.
Logical Operations
These instructions perform various logical operations with the contents of the accumulator.
AND, OR Exclusive-OR - Any 8-bit number, or the contents of a register, or of a memory
location can be logically ANDed, Ored, or Exclusive-ORed with the contents of the
Page 15 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 16 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
In the first instruction, operand and registers are specified. In the second instruction,
the operand B is specific and the accumulator is not there. Similarly, in the third instruction,
the accumulator is assume to be the implicit operand.
Two-byte instructions
In a two-byte instruction, the first byte specifies the operation code and second byte specifies
the operand.
Task Opcode Operand Binary code Hex code
Load an 8-bit data byte MVI A 35H 0011 1110 3EH First byte
in the accumulator.
0011 0101 35H Second byte
Three-byte instructions
In a three-byte instruction, the first byte specifies the opcode, and the following two
bytes specify the 16-bit operand. The second byte is the low-order operand and the third byte
is the high-order operand. If a 16-bit numeral is present in the instruction then that instruction
will be of three-byte. For example, in LXI H,3500H and STA 2500H, etc.
Task Opcode Operand Binary code Hex code
Opcode Format
Page 17 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
specific bit pattern unique for each instruction. These bit patterns contain all the information
about operation, register used, memory to. The register and register pair are specified by using
certain combination of bits. These combinations of bits are in table below.
Data Format
In 8-bit processor systems, commonly used codes and data formats are,
ASCII Code- This is a 7-bit alphanumeric code that represents decimal numbers, English
alphabets and non-printable characters such as carriage return.
BCD Code- The term BCD stands for binary-coded decimal; it is used for decimal
numbers. The decimal numbering system has ten digits.
Signed Integer- A signed integer is either a positive number or a negative number. In a 8-
bit processor, the most significant digit, d7, is used for the sign; 0 represents the positive
sign and 1 represents the negative sign.
Unsigned Integer- A integer without a sign can be represented by all the 8 bits in a
Microprocessor register.
Data Storage: Memory
Memory is a storage of binary bits. Memory chips used in most systems are nothing but 8-bit
registers stacked one above the other.
How to write, assemble and execute a simple program
A program is a sequence of instruction written to tell a computer to perform a specific function.
Illustrative Program: Adding Two Hexadecimal Numbers
Problem – Write instructions to load 2 hexa-decimal numbers 32H and 48H in registers A and
B,respectively. Add the numbers and display the sum at LED output port PORT1.
Problem analysis
Load the numbers in the registers.
Add the numbers.
Page 18 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 19 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Enter the address of the memory 2000H, where the first hex code (starting address
of theprogram) is to be stored using hex keys.
Enter the hex code using hex keys.
Increment the memory address by 1 using INC key.
Repeat steps 4 and 5 until the last hex code.
Executing the Program:
The microprocessor training kit provides a procedure to execute the program. To
activate the procedure we have to enter the starting address of the program (2000H in our
example). To enter this address we have to go into execute mode by pressing GO key and enter
the starting address using hex keys.
Once the starting address is entered, the program can be executed by pressing
EXECUTE key. The EXECUTE key procedure loads the starting address of our program,
2000H into the program counter and program control is transferred from monitor program to
our program.
After this microprocessor reads one hex code at a time, and when it fetches the complete
instruction, it executes that instruction. Then it fetches the next instruction and this process
continues until the last instruction in the program is executed.
Overview of the 8085 instruction set
The 8085 microprocessor instruction set has 74 operation codes that result in 246 instructions.
Data transfer instructions in 8085 microprocessor
Data transfer instructions are the instructions which transfers data in the microprocessor.
They are also called copy instructions.
Page 20 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
LXI r.p., 16-bit data loads the specified register pair LXI H, 3050
with data
OUT 8-bit port address outputs contents of A to the specified port OUT 15
Page 21 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 22 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
In the table,
R stands for register M stands for memory
Mc stands for memory contents
r.p. stands for register pair
ORA R A = A OR R ORA B
Page 23 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
In the table,
R stands for register M stands for memory
Mc stands for memory contents
Branching instructions in 8085 microprocessor
Branching instructions refer to the act of switching execution to a different instruction sequence
as a result of executing a branch instruction.
The three types of branching instructions are:
Jump (unconditional and conditional)
Call (unconditional and conditional)
Return (unconditional and conditional)
1. Jump Instructions – The jump instruction transfers the program sequence to the memory
address given in the operand based on the specified flag. Jump instructions are 2 types:
Unconditional Jump Instructions and Conditional Jump Instructions.
Unconditional Jump Instructions: Transfers the program sequence to the described memory
address.
Page 24 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
2. Call Instructions – The call instruction transfers the program sequence to the memory
address given in the operand. Before transferring, the address of the next instruction after
CALL is pushed onto the stack. Call instructions are 2 types: Unconditional Call Instructions
and Conditional Call Instructions.
Unconditional Call Instructions: It transfers the program sequence to the memory
address given in the operand.
Page 25 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Return Instructions – The return instruction transfers the program sequence from the
subroutine to the calling program. Jump instructions are 2 types: Unconditional Jump
Instructions and Conditional Jump Instructions.
(a) Unconditional Return Instruction: The program sequence is transferred
unconditionally from the subroutine to the calling program.
Page 26 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 27 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
UNIT II
MICROPROCESSOR ARCHITECTURE AND MICROCOMPUTER SYSTEMS
Microprocessor Architecture and its operations
The microprocessor is a programmable logic device, designed with registers, flip-flops.
The microprocessor has a set of instructions designed internally, to manipulate data and
communicate with peripherals. This process of data manipulation and communication is
determined by the logic design of the microprocessor, called the architecture.
The microprocessor can be programmed to perform functions on given data by selecting
necessary instructions from its set. These instructions are given to the microprocessor by
writing them into its memory. Writing (Or entering) instruction and data is done through an
input device such as a keyboard. The result can be stored in memory or scent to such output
devices as LEDs or a CRT terminal. All the various functions performed by the microprocessor
can be classified in three general categories:
Microprocessor-initiated operations
Internal data operations
Peripheral (or externally) initiated operations.
To perform these functions, the microprocessor requires a group of logic circuits and a
set of signals called control signals. However, early processors do not have the necessary
circuitry on one chip; the complete units are made up more than one chip. Therefore, the term
Micro Processing Unit (MPU) is defined here as a group of devices that can perform these
functions with the necessary set of control signals. This term is similar to the term Central
Processing Unit (CPU).
Microprocessor-Initiated Operations and 8085/8080A Bus Organization
The MPU performs primarily four operations:
Memory Read: Reads data from memory.
Memory Write: Writes data into memory.
I/O read: Accepts data from input devices.
I/O Write: Sends data to output devices.
All these operations are part of the communication process between the MPU and
peripheral devices (including memory). To communicate with a peripheral (or a memory
location), the MPU needs to perform the following steps:
Step 1: Identify the peripheral or the memory location (with its address).
Step 2: Transfer data
Step 3: Provide timing or synchronization signals.
The 8085/8080A MPU performs these functions using three sets of communication lines called
Page 28 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
buses: The address bus, the data bus, and the control bus.
Internal Data Operations and the 8085/8080A Registers
The internal architecture of the 8085/8080A microprocessor determines how and what
operations can be performed with the data. These operations are,
Store 8-bits data.
Perform arithmetic and logical operations.
Test for conditions.
Sequence the execution of instructions.
Store data temporarily during execution in the defined R/W memory locations
called the stack.
To perform these operations, the microprocessor requires registers, an arithmetic
logic unit (ALU) and control logic, and internal buses (path for information flow).
Externally Initiated Operations in Microprocessor
8085 microprocessor support some Externally initiated operations, which are also known as
Peripheral operations. Different external input/output devices or signals can initiate these type
operations. Following are the some externally initiated operations:
1. RESET–
This RESET key is used to clear the program counter and update with 0000H memory
location. When this RESET pin is activated by any external key, then all the internal
operations are suspended for that time. After that the execution of the program can begin
at the zero memory address.
2. Interrupt–
8085 microprocessor chip have some pins for interrupt like TRAP, RST 5.5, RST 6.5 and
RST
7.5. The microprocessor can be interrupted from the normal instructions and asked to
perform some other emergency operations, which are also known as Service routine. The
microprocessor resumes its operation after the completion Service routine.
3. READY–
The 8085 microprocessor has a pin called READY. If the signal at this READY pin is in
low state then the microprocessor enters into the Wait state. This signal is used mainly to
synchronize slower external devices with the microprocessor.
4. HOLD–
When the HOLD pin is activated by an external signal, the microprocessor relinquishes
control buses and allows the external peripheral to use them. For example, the HOLD signal
is used direct memory access (DMA) data transfer.
Page 29 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
MEMORY
Memory is an essential component of a microcomputer system. It stores binary
instructions and data for the microprocessor. There are two types of memory: Read/Write
Memory(R/WM) and Read-Only Memory (ROM).
Memory Organization (R/W Memory): To communicate with memory, the MPU shouldbe
able to:
select the chip
Identify the register
Read from or Write into the register
Figure (a) shows memory chip of eight register with three address lines, one chip select
(CS) line, one read write (R/W) line, and eight I/O lines. The MPU uses the CS line to select
the chip, and the R/W line to control data flow.
Memory Map
Memory map is defined as the assignment of addresses to memory registers in various
memory chips in a system. In a system based on the 8085/8080A microprocessor, the entire
memory map can range from 0000h to FFFFh (216= 65.536).
Example-1- Illustrate the memory map of the chip with 256 bytes of memory and hardware of
the chip select (CS) line in fig 2.
Page 30 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 31 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 32 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
system. The eight address lines have 2^8 combinations which is total 256 addresses; therefore
MPU can identify 256 input devices and 256 output devices with addresses ranging from 00H
to FFH.
The input and output devices can be differentiated by using the control lines I/O Read
and I/O Write. MPU uses I/O Read control signal for input devices and I/O Write control signal
for output devices.
I/Oswith16-bitaddresses–
This is also known as Memory-mapped I/O. In this type of I/O, MPU uses sixteen
address lines to identify an input or an output devices; an I/O is connected as if it is a memory
register. The MPU uses same control signal (Memory Read and Memory Write) and
instructions as those of memory. In some microprocessors, such as the Motorola 6800, all I/Os
have 16-bit addresses; I/Os and memory share the same memory map (64K). The steps are
summarized below:
The MPU places an 8-bit address (or 16-bit address) on the address bus, which is
decoded by external decode logic.
The MPU sends a control signal (I/O Read or I/O Write) and enables the I/O device.
Data are transferred using the data bus.
Example of microcomputer system
Page 33 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
This microcomputer system has 8 data lines D0-D7 which are bidirectional and
common to all the [Link] generates four control signals: Memory Read, Memory Write,
I/O Read and I/O Write and they are connected to different peripheral devices. The MPU
communicates with only one peripheral at a time by enabling that peripheral through its control
signal.
For example, sending a data to the output device, the MPU places the device address
(or output port number) on the address bus, data on the data bus and enables the output device
by using its control signal I/O Write. After that the output device display the result.
Page 34 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
ALU - Address Latch Enable: This is a positive going pulse generated every time the
8085, begins an operation (machine cycle); it indicates that the bits on AD7 - AD0 are
address bits. This signal is used primarily to latch the low-order address from the
multiplexed bus and generate a separate set of eight address lines, A7 to A0.
RD - Read: This is a Read control signal (active low). This signal indicates that the
selected I/O or memory device is to be read and data are available on the data bus.
WR - Write: This is a Write control signal (active low). This signal indicates that the
data on the bus are to be written into a selected memory or I/O location.
Page 35 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
IO/M: This is a status signal to differentiate between I/O and memory operations. When
it is high, it indicates and I/O Operation; when it is low, it indicates a memory operation.
This signal is combined with RD (Read) and WR (Write) to generate I/O and memory
control signals.
S1 and S0: There status signals, similar to IO/M, can identify various operations; but
they are rarely used in small systems.
TRAP 0024
Page 36 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
automatically inserted.
The TRAP has the highest priority among interrupts. The order of priority of interrupts is as
follows:
TRAP (Highest priority)
RST 7.5
RST 6.5
RST 5.5
INTR (Lowest priority).
Reset Signals
RESET IN (Input): It resets the program counter (PC) to 0. It also resets interrupt
enable and HLDA flip-flops. The CPU is held in reset condition till RESET is not
applied.
RESET OUT (Output): RESET OUT indicates that the CPU is being reset.
Clock Signals
X1, X2 (Input): X1 and X2 are terminals to be connected to an external crystal
oscillator which drives an internal circuitry of the microprocessor. It is used to produce
a suitable clockfor the operation of microprocessor.
CLK (Output): CLK is a clock output for user, which can be used for other digital
ICs. Itsfrequency is same at which processor operates.
Serial I/O Signals
SID (Input): SID is data line for serial input. The data on this line is loaded into the
seventhbit of the accumulator when RIM instruction is executed.
SOD (Output): SOD is a data line for serial output. The seventh bit of the accumulator
isoutput on SOD line when SIM instruction is executed.
Page 37 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
1. ALU
The ALU performs the actual numerical and logic operation such as ‘add’, ‘subtract’,
‘AND’,
‘OR’ etc.
Uses data from memory and from Accumulator to perform arithmetic operation and
always stores result of operation in Accumulator.
The ALU consists of accumulator, flag register and temporary register.
a) Accumulator :-
The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU). This register
is used to store 8-bit data and to perform arithmetic and logical operations. The result of an
operation is stored in the accumulator. The accumulator is also identified as register A.
b) Flag Register:-
8085 has 8-bit flag register. Flags are flip-flops which are used to indicate the status of the
accumulator and other register after the completion of operation. There are only 5 active flags.
S Z AC P CY
Page 38 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
i. Sign flag(S):
Sign flag indicates whether the result of a mathematical or logical operation is negative
or positive. If the result is negative, this flag will be set (i.e. S=1) and if the result is positive,
the flag will be reset (i.e. S=0).
ii. Zero flag (Z):
Zero flag indicates whether the result of a mathematical or logical operation is zero or
not. If the result of current operation is zero, the flag will be set (i.e. Z=1) otherwise the flag
will be reset (Z=0). This flag will be modified by the result in the accumulator as well as in the
other register.
iii. Auxiliary carry flag (AC):
In operation when a carry is generated by bit D3 and passes on to bit D4, the AC flag
will be set otherwise AC flag will be reset. This flag is used only internally for BCD operation
and is not available for the programmer to change the sequence of program with the jump
instruction.
iv. Parity flag (P):
This flag indicates whether the current result is of even parity (no. of 1’s is even) or odd
parity(no. of 1’s is odd). If even parity, P flag will be set otherwise reset.
v. Carry flag (CY):
This flag indicates whether during an addition or subtraction operation carry or borrow is
generated or not. If carry or borrow is generated, the flag will be set otherwise reset.
a) Temporary register
It is an 8-bit register, which holds the temporary data of arithmetic and logical operations.
This unit produces all the timing and control signal for all the operation.
This unit synchronizes all the MP operations with the clock and generates the
controlsignals necessary for communication between the MP and peripherals.
3. Instruction register and decoder
The instruction register and decoder are part of ALU. When an instruction is fetched
frommemory, it is loaded in the instruction register.
The decoder decodes the instruction and establishes the sequence of events to follow.
The IR is not programmable and cannot be accessed through any instruction.
4. Register array
The register unit of 8085 consists of
Page 39 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 40 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 41 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 42 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
memory structure and its requirements, concepts in Memory Interfacing in 8085 and
interfacing examples.
Memory Structure and its Requirements
As mentioned earlier, read/write memories consist of an array of registers, in which
each register has unique address. The size of the memory is N x M as shown in Fig. 1 where N
is the number of registers and M is the word length, in number of bits.
Fig 1
Basic Concepts in Memory Interfacing:
For Memory Interfacing in 8085, following important points are to be kept in mind.
Microprocessor 8085 can access 64Kbytes memory since address bus is 16-bit. But it is not
always necessary to use full 64Kbytes address space. The total memory size depends upon the
application.
1. Generally EPROM (or EPROMs) is used as a program memory and RAM (or RAMs) as a
data memory. When both, EPROM and RAM are used, the total address space 64Kbytes
is shared by them.
2. The capacity of program memory and data memory depends on the application.
3. It is not always necessary to select 1 EPROM and 1 RAM. We can have multiple EPROMs
and multiple RAMs as per the requirement of application.
4. We can place EPROM/RAM anywhere in full 64 Kbytes address space. But program
memory (EPROM) should be located from address 0000H since reset address of 8085
microprocessor is 0000H.
5. It is not always necessary to locate EPROM and RAM in consecutive memory For example:
If the mapping of EPROM is from 0000H to OFFFH, it is not must to locate RAM from
1000H. We can locate it anywhere between 1000H and FFFFH. Where to locate memory
component totally depends on the application.
Page 43 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 44 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
UNIT III
DATA TRANSFER OPERATION
Data transfer (Copy) operations
It is the longest group of instructions in 8085. This group of instruction copy data from
a source location to destination location without modifying the contents of the source. The
transfer of data may be between the registers or between register and memory or between an
I/O device and accumulator. None of these instructions changes the flag. The instructions of
this group are:
–E.g. MOV A, B
–E. g. MOV B, M
Write a program to load memory locations 7090 H and 7080 H with data 40H and 50H
and then swap these data.
Soln : MVI H, 70H MVI L, 90H
Page 45 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
MVI A, 40H MOV M, A MOV C, M MVI L, 80H MVI B, 50H MOV M, B MOV D, M
MOV M, C MVI L, 90H MOV M, D HLT
2-byte instruction
Read data from the input port address specified in the second byte and loads data into the
accumulator.
9) OUT 8-bit address
2-byte instruction
Copies the contents of the accumulator to the output port address specified in the 2nd byte.
That means accumulator to output port: P A
Addressing modes:
Instructions are command to perform a certain task in microprocessor. The instruction
Page 46 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
consists of op-code and data called operand. The operand may be the source only, destination
only or both of them. In these instructions, the source can be a register, a memory or an input
port. Similarly, destination can be a register, a memory location, or an output port. The various
format (way) of specifying the operands are called addressing mode. So addressing mode
specifies where the operands are located rather than their nature. The 8085 has 5 addressing
mode:
Page 47 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
ADD C 101 0 0 1 01 0 1 4A
CY CY
Page 48 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
– Logically AND 8 bit immediate data with the contents of accumulator, 2 byte
instruction and CY flag is reset and AC is set.
3. ORA R/M
– Logically OR 8 bit immediate data with the contents of the accumulator,2 byte
instruction and CY and AC is reset and other as per result.
5. XRA R/M
Page 49 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Branching Operations:
The microprocessor is a sequential machine; it executes machine codes from one
memory location to the next. The branching instructions instruct the microprocessor to go to a
different memory location and the microprocessor continues executing machine codes from
that new location.
The branching instructions are the most powerful instructions because they allow the
microprocessor to change the sequence of a program, either unconditionally or under certain
test conditions. The branching instruction code categorized in following three groups:
Jump instructions
Call and return instruction
Restart instruction
Jump Instructions:
The jump instructions specify the memory location explicitly. They are 3 byte
instructions, one byte for the operation code followed by a 16 bit (2 byte) memory address.
Jump instructions can be categorized into unconditional and conditional jump.
Unconditional Jump
8085 includes unconditional jump instruction to enable the programmer to set up
continuous loops without depending only type of conditions. E.g. JMP 16 bit address: loads the
program counter by 16 bit address and jumps to specified memory location.
E.g. JMP 4000H
Here, 40H is higher order address and 00H is lower order address. The lower order byte.
Conditional Jump
The conditional jump instructions allow the microprocessor to make decisions based
on certain conditions indicated by the flags. After logic and arithmetic operations, flags are ser
or reset to reflect the condition of data. These instructions check the flag conditions and make
decisions to change or not to change the sequence of program. The four flags namely carry,
zero, sign and parity used by the jump instruction.
Mnemonics Description
Page 50 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
2. RET
Returns from the subroutine unconditionally.
1 byte instruction
Inserts the contents of stack pointer to program counter.
E.g. Write an ALP to add two numbers using subroutines.
2007 MOV B, A
Page 51 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 52 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Add register E to A
Copy A to register C
DEBUGGING A PROGRAM
Debugging is the process of identifying and removing bug from software or program.
It refers to identification of errors in the program logic, machine codes, and execution. It gives
step by step information about the execution of code to identify the fault in the program.
The debugging process is divided into two parts:
Static Debugging: It is similar to visual inspection of circuit board, it is done by a paper and
pencil to check the flowchart and machine codes. It is used to the understanding of code logic
and structure of program.
Dynamic Debugging: It involves observing the contents of register or output after execution
ofeach instruction (in single step technique) or a group of instructions (in breakpoint technique).
Common sources of error:
Selecting a wrong code
Forgetting second or third byte of instruction Specifying wrong jump locations
Page 53 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Not reversing the order of high and low bytes in a Jump instruction writing memory addresses
in decimal instead of hexadecimal.
PROGRAMMING TECHNIQUES WITH ADDITIONAL INSTRUCTIONS
PROGRAMMING TECHNIQUES: LOOPING, COUNTING AND INDEXING
The Programming Technique used to instruct the microprocessor to repeat task is called
looping. This process is accomplished by using jump instructions. A loop can be classified into
two groups:
Continuous loop- repeats a task continuously
Conditional loop-repeats a task until certain data condition are met
Continuous loop
A continuous loop is set up by using the unconditional jump Instruction shown in the
flowchart. A program with Continuous loop does not stop repeating the tasks until the system
is reset.
Conditional Loop
A Conditional loop is setup by the conditional jump instructions. These instructions
Check flags (zero, carry, etc.) and repeat the specified task if the conditions are satisfied. These
loops usually include counting and indexing. Conditional loop is shown by the Flowchart as
follow.
Page 54 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
1. 16 BIT DATA TRANSFER TO REGISTER PAIR (LXI) LXI Reg. pair, 16-bit data.
-The instruction loads 16-bit data in the register pair designated in the operand.
Example: LXI H, 2034H or LXI H, XYZ
-R, M copies data byte from Memory to Register. Memory location, its location is
specified by the contents of the HL registers.
Example: MOV B, M
Load accumulator indirect LDAX B/D Reg. pair
- The contents of the designated register pair point to a memory location. This
instruction copies the contents of that memory location into the accumulator. The contents
of either the register pair or the memory location are not altered.
Example: LDAX B
Load accumulator Direct LDA 16-bit address
-The contents of a memory location, specified by a 16-bit address in the operand, are
copied to the accumulator.
Example: LDA 2034H
Page 55 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 56 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 57 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
DYNAMIC DEBUGGING
Checking for logical and syntax errors in the program is called as debugging.
TYPES:
STATIC
DYNAMIC
STATIC DEBUGGING:
Checking for errors in the program manually using paper and pencil is known as static
debugging.
Page 58 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
DYNAMIC DEBUGGING:
Checking for errors in the program by observing the execution of instructions is called as
DYNAMIC DEBUGGING.
TOOLS FOR DYNAMIC DEBUGGING:
SINGLE STEP
REGISTER EXAMINE [Link] POINT
SINGLE STEP:
Allows you to execute one instruction at a time and observe the results of each
instruction.
A Single step facility is built with a hard wired logic circuit.
By pressing Single-step key in the microprocessor, able to observe addresses and codes
as they are executed.
Single-step technique will be able to spot incorrect address
Incorrect jump locations for loops incorrect data or missing codes.
To effectively use this technique reduce the number of loops and delay counts to
minimum number.
Better to use this technique for short programs.
This technique helps to infer the flag status by observing the execution of jump
instructions.
REGISTER EXAMINE:
Register Examine Key in the microprocessor allows to examine the contents of
the microprocessor register.
By pressing appropriate keys, the monitor program displays the contents of the
registers.
This technique is used in conjunction with either the single step or break point facilities.
After executing a block of instructions, we can examine the register contents of the
program at a critical juncture and compare the contents with the expected outcomes.
BREAK POINT:
Breakpoint facility is a software routine that allows to execute a program in sections.
The break point in a program can be set in a program using RST instructions.
When we push the EXECUTE key, program will be executed until the breakpoint, using
Page 59 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 60 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
UNIT IV
COUNTERS AND TIME DELAYS
Counter and time delays
A counter is designed simply by loading appropriate number into one of the
registers and using INR or DNR instructions. Loop is established to update the count. Each
count is checked to determine whether it has reached final number; if not, the loop is
repeated.
TIME DELAY
Procedure used to design a specific delay. A register is loaded with a number,
depending on the time delay required and then the register is decremented until it reaches
zero by setting up a loop with conditional jump instruction.
Page 61 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 62 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
= 109 ms
Page 63 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Write a Program to count continuously from FFH to 00H using register C with delaycount
8CH between each count and display the number at one of the output ports.
Page 64 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Generates a continuous square wave with the period of 500 Micro Sec. Assume the system
clock period is 325ns, and use bit D0 output the square wave
Page 65 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 66 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 67 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Subroutines
A subroutine is a group of instructions that will be used repeatedly in different
locations of the program.
– Rather than repeat the same instructions several times, they can be grouped into a
subroutine that is called from the different locations.
In Assembly language, a subroutine can exist anywhere in the code.
– The RET instruction is used to return the execution to the calling routine.
The CALL Instruction
CALL 4000H (3 byte instruction)
– When CALL instruction is fetched, the MP knows that the next two Memory location
contains 16bit subroutine address in the memory.
The RET Instruction
RET (1 byte instruction)
Page 68 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
The CALL instruction places the return address at the two memory locations
immediatelybefore where the Stack Pointer is pointing.
Set the SP correctly BEFORE using the CALL instruction. The RET instruction takes
the contents of the two memory locations at the top of the stack and uses these as the return
address. Do not modify the stack pointer in a subroutine.
Number of PUSH and POP instruction used in the subroutine must be same, otherwise,
RET instruction will pick wrong value of the return address from the stack and program will
fail.
Passing Data to a Subroutine
– Call by Reference:
The data is stored in one of the registers by the calling program and the subroutine uses
the value from the register. The register values get modified within the subroutine. Then these
modifications will be transferred back to the calling program upon returning from a subroutine
– Call by Value:
The data is stored in one of the registers, but the subroutine first PUSHES register values
in the stack and after using the registers, it POPS the previous values of the registers from the stack
while exiting the subroutine.
i.e. the original values are restored before execution returns to the calling program.
The other possibility is to use agreed upon memory locations.
– The calling program stores the data in the memory location and the subroutine retrievesthe
data from the location and uses it.
Page 69 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
– If not, the RET statement will pick up the wrong information from the top of the stackand
the program will fail.
It is not advisable to place PUSH or POP inside a loop.
Conditional CALL and RTE Instructions
The 8085 supports conditional CALL and conditional RTEinstructions.
– The same conditions used with conditional JUMP instructions can be used
Write a Program that will display FF and 11 repeatedly on the seven segment display.
Write a ‘delay’ subroutine and Call it as necessary.
C000: LXISP FFFF C003: MVIA FF C005: OUT 00
C007: CALL 14 20
C00A: MVIA 11
C00C: OUT 00
C00E: CALL 14 20 C011: JMP 03 C0
DELAY: C014: MVIB FF C016: MVIC FF
C018: DCR C C019: JNZ 18 C0 C01C: DCR B C01D: JNZ 16 C0 C020: RET
Page 70 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
UNIT V
CONVERSIONS
Page 71 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
If the value in the accumulator equals 0, then BCD2 is the final answer and store it in the
memory location, 2020H (arbitrary).
Else, shift the accumulator to right 4 times to obtain BCD1. Next step is to multiply BCD1 by
0A.
Multiplication: Move BCD1 to D and initialise E with 0AH as the counter. Clear the
accumulator to 0 and add D to it E number of times.
Finally, add C to the accumulator and store the result in 2020H
2001H
2002H
2003H MOV B, A
2005H
2006H MOV C, A
2007H MOV A, B
2009H
200AH JZ
SKIPMULTIPLY
200BH
200CH
200DH RRC
Page 72 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
200EH RRC
200FH RRC
2010H RRC
2011H MOV D, A
2012H XRA A
2014H
2016H DCR E
2018H
2019H
201CH
201DH
201EH HLT
Binary-to-BCD conversion
The microprocessor processes data in binary form but data that is displayed is in BCD form.
Hence, we require to convert the binary data to BCD.
Page 73 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Here we are taking a number from the memory, and initializing it as a counter. Now
Problem Statement
A binary number is store dat location 800H. Convert the number into its BCD equivalent
and store it to the memory location 8050H.
Discussion
in each step of this counter we are incrementing the number by 1, and adjust the decimal value.
By this process we are finding the BCD value of binary number or hexadecimal number. We
can use INR instruction to increment the counter in this case but this instruction will not affect
carryflag, so for that reason we have used ADI 10H.
Page 74 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Program
F007 C6, 01 LOOP ADI 01H Count the number one by one
Page 75 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
BCD ADDITION
Page 76 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 77 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 78 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 79 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
BCD SUBTRACTION
MULTIPLICATION
Problem – Multiply two 8 bit numbers stored at address 2050 and 2051. Result is stored at
address 3050 and 3051. Starting address of program is taken as 2000.
Example –
Algorithm –
Page 80 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
2012 HLT
OUTPUT:
(2054H) = 04H
(2055H) = OEH
Algorithm –
Get the LSB in L register and MSB in H register of 16 Bit number.
Exchange the content of HL register with DE register.
Again Get the LSB in L register and MSB in H register of 16 Bit number.
Subtract the content of L register from the content of E register.
Subtract the content of H register from the content of D register and borrow from
Previous step.
Page 81 of 82
STUDY MATERIAL FOR B.C.A
MICRO PROCESSORS
IV- SEMESTER, ACADEMIC YEAR 2022-2023
Page 82 of 82