Lecture Note Four on Microprocessor RISC & CISC 03122024
Lecture Note Four on Microprocessor RISC & CISC 03122024
(CSC 303)
03/12/2024 1
Microprocessor – Overview
As its name implies, it is a processing device that converts data
into information based on some sets of instructions. It is a very
compact electronic chip due to which it is referred to as the
microprocessor.
In other words, a processing device implemented on a single
chip is called a microprocessor. A microprocessor is the most
crucial component of a computer or any other computing
device. Because, it is entirely responsible for processing data
based on instructions to produce information.
03/12/2024 2
In microcomputers, the microprocessor is used as the CPU
(Central Processing Unit). A typical microprocessor consists of
two major parts namely ALU (Arithmetic Logic Unit) and CU
(Control Unit). Intel 8085 or 8086 processing chips are the
examples of microprocessors.
Modern microprocessors consist of a small memory unit (cache
memory) in addition to the ALU and CU. Modern,
microprocessors are being widely used in several applications
such as desktop publishing, power plant control, mustimeters,
medical instruments, etc.
03/12/2024 3
We can also define it that microprocessor is a controlling unit of
a micro-computer, fabricated on a small chip capable of
performing ALU (Arithmetic Logical Unit) operations and
communicating with the other devices connected to it.
It consists of an ALU, register array, and a control unit. ALU
performs arithmetical and logical operations on the data
received from the memory or an input device. Register array
consists of registers identified by letters like B, C, D, E, H, L
and accumulator. The control unit controls the flow of data and
instructions within the computer
03/12/2024 4
Block Diagram of a Basic Microcomputer
03/12/2024 5
How does a Microprocessor Work?
The microprocessor follows a sequence: Fetch, Decode, and
then Execute.
Initially, the instructions are stored in the memory in a
sequential order. The microprocessor fetches those instructions
from the memory, then decodes it and executes those
instructions till STOP instruction is reached. Later, it sends the
result in binary to the output port. Between these processes, the
register stores the temporarily data and ALU performs the
computing functions.
03/12/2024 6
List of Terms Used in a Microprocessor
Here is a list of some of the frequently used terms in a microprocessor −
Instruction Set − It is the set of instructions that the microprocessor can
understand.
Bandwidth − It is the number of bits processed in a single instruction.
Clock Speed − It determines the number of operations per second the processor
can perform. It is expressed in megahertz (MHz) or gigahertz (GHz).It is also
known as Clock Rate.
Word Length − It depends upon the width of internal data bus, registers, ALU,
etc. An 8-bit microprocessor can process 8-bit data at a time. The word length
ranges from 4 bits to 64 bits depending upon the type of the microcomputer.
Data Types − The microprocessor has multiple data type formats like binary,
BCD, ASCII, signed and unsigned numbers.
03/12/2024 7
Features of a Microprocessor
Here is a list of some of the most prominent features of any microprocessor −
Cost-effective − The microprocessor chips are available at low prices and
results its low cost.
Size − The microprocessor is of small size chip, hence is portable.
Low Power Consumption − Microprocessors are manufactured by using metal
oxide semiconductor technology, which has low power consumption.
Versatility − The microprocessors are versatile as we can use the same chip in a
number of applications by configuring the software program.
Reliability − The failure rate of an IC in microprocessors is very low, hence it
is reliable.
03/12/2024 8
Microprocessor – Classification: A microprocessor can be classified into three categories −
Before we discuss further on this, there is need to understand the overview of microcontrollers
03/12/2024 9
What is a Microcontroller?
A microcontroller is an electronic system which
consists of a processing element, a small memory
(RAM, ROM, EPROM), I/O ports, etc. on a single
chip. Therefore, a microcontroller is a tiny
resemblance of a microcomputer. It is a quite small
and low−cost electronic device which is used in
several electronic appliances as the main
functioning device.
03/12/2024 10
In electronic systems such as washing
machines, air conditioners, refrigerators, etc.,
microcontrollers are used to automate the
operation of the device based on user’s
instructions. Hence, a microcontroller is the
backbone of all embedded systems like
microwave oven, washing machine, smart
refrigerators, etc.
03/12/2024 11
Microprocessors find their application in light
sensing and controlling devices, temperature sensing
and controlling devices, fire detection and other
safety devices, smart measuring instruments
It can also be defined as a small and low-cost
microcomputer, which is designed to perform the
specific tasks of embedded systems like displaying
microwave’s information, receiving remote signals,
etc.
03/12/2024 12
Features of Modern Microcontrollers
Built-in Monitor Program
Built-in Program Memory
Interrupts
Analog I/O
Serial I/O
Facility to Interface External Memory
Timers
03/12/2024 13
Basic Structure of a Microcontroller
03/12/2024 14
From the above image, you can understand that the three
important (or major) components of a Microcontroller are:
The CPU (Central Processing Unit)
The Memory and
The I/O Ports
This doesn’t mean that other components are of less
importance. But these can be considered as supporting devices.
We will now see each of the Basic Components of a
Microcontroller mentioned in the above structure.
03/12/2024 15
1. CPU: Central Processing Unit or CPU is the brain of the
Microcontroller. It consists of an Arithmetic Logic Unit (ALU) and a
Control Unit (CU). A CPU reads, decodes and executes instructions to
perform Arithmetic, Logic and Data Transfer operations.
2. Memory: Any Computational System requires two types of
Memory: Program Memory and Data Memory. Program Memory, as
the name suggests, contains the program i.e. the instructions to be
executed by the CPU. Data Memory on the other hand, is required to
store temporary data while executing the instructions.
Usually, Program Memory is a Read Only Memory or ROM and the
Data Memory is a Random Access Memory or RAM. Data Memory is
sometimes
03/12/2024 called as Read Write Memory (R/W M). 16
3. I/O Ports
The interface for the Microcontroller to the external world is provided
by the I/O Ports or Input/Output Ports. Inputs device like Switches,
Keypads, etc. provide information from the user to the CPU in the
form of Binary Data.
The CPU, upon receiving the data from the input devices, executes
appropriate instructions and gives response through Output Devices
like LEDs, Displays, Printers, etc.
03/12/2024 17
4. Bus: Another important component of a Microcontroller, but
rarely discussed is the System Bus. A System bus is a group of
connecting wire that connect the CPU with other peripherals
like Memory, I/O Ports and other supporting components.
5. Timers/Counters: One of the important components of a
Microcontroller are the Timers and Counters. They provide the
operations of Time Delays and counting external events.
Additionally, Timers and Counters can provide Function
Generation, Pulse Width Modulation, Clock Control, etc
03/12/2024 18
6. Serial Port: One of the important requirement of a Microcontroller
is to communicate with other device and peripherals (external). Serial
Port proves such interface through serial communication. Most
common serial communication implemented in Microcontrollers is
UART.
7. Interrupts: A very important feature of a Microcontroller is
Interrupts and its Interrupt Handling Mechanism. Interrupts can be
external, internal, hardware related or software related.
03/12/2024 19
8. ADC (Analog to Digital Converter):Analog to Digital Converter
or ADC is a circuit that converts Analog signals to Digital Signals.
The ADC Circuit forms the interface between the external Analog
Input devices and the CPU of the Microcontroller. Almost all
sensors are analog devices and the analog data from these sensors
must be converted in to digital data for the CPU to understand.
03/12/2024 22
Applications of Microcontrollers: There are huge number of applications of
Microcontrollers. In fact, the entire embedded systems industry is dependent on
Microcontrollers. The following are few applications of Microcontrollers.
Front Panel Controls in devices like Oven, washing Machine etc.
Function Generators
Smoke and Fire Alarms
Home Automation Systems
Automatic Headlamp ON in Cars
Speed Sensed Door Locking System
In this lecture, we have seen the basics of Microcontrollers, Basic Structure of a
Microcontroller, different components of a Microcontroller, advantages,
disadvantages and applications of Microcontrollers.
03/12/2024 23
03/12/2024 24
Instruction Set
Based on the instruction set configuration, the microcontroller
can also be further divided into two categories as stated earlier
in the microprocessor above
CISC − CISC stands for complex instruction set computer. It
allows the user to insert a single instruction as an alternative
to many simple instructions.
RISC − RISC stands for Reduced Instruction Set Computers.
It reduces the operational time by shortening the clock cycle
per instruction.
03/12/2024 25
A. RISC Processor: RISC stands for Reduced Instruction Set Computer. It is
designed to reduce the execution time by simplifying the instruction set of the
computer. Using RISC processors, each instruction requires only one clock cycle
to execute results in uniform execution time. This reduces the efficiency as there
are more lines of code, hence more RAM is needed to store the instructions. The
compiler also has to work more to convert high-level language instructions into
machine code.
Some of the RISC processors are −
Power PC: 601, 604, 615, 620
DEC Alpha: 210642, 211066, 21068, 21164
MIPS: TS (R10000) RISC Processor
PA-RISC: HP 7100LC
03/12/2024 26
Architecture of RISC: RISC microprocessor architecture uses highly optimized set of instructions. It is used in
portable devices like Apple iPod due to its power efficiency.
03/12/2024 27
Characteristics of RISC
The major characteristics of a RISC processor are as follows −
It consists of simple instructions.
It supports various data-type formats.
It utilizes simple addressing modes and fixed length instructions for pipelining.
It supports register to use in any context.
One cycle execution time.
“LOAD” and “STORE” instructions are used to access the memory location.
It consists of larger number of registers.
It consists of a smaller number of transistors.
03/12/2024 28
The Advantages of RISC architecture
RISC (Reduced instruction set computing) architecture has a set of instructions, so high-
level language compilers can produce more efficient code
It allows freedom of using the space on microprocessors because of its simplicity.
Many RISC processors use the registers for passing arguments and holding the local
variables.
RISC functions use only a few parameters, and the RISC processors cannot use the call
instructions, and therefore, use a fixed length instruction which is easy to pipeline.
The speed of the operation can be maximized and the execution time can be minimized.
Very a smaller number of instructional formats, a few numbers of instructions and a few
addressing modes are needed.
03/12/2024 29
The Disadvantages of RISC architecture
Mostly, the performance of the RISC processors depends on the
programmer or compiler as the knowledge of the compiler plays a
vital role while changing the CISC code to a RISC code
While rearranging the CISC code to a RISC code, termed as a code
expansion, will increase the size. And, the quality of this code
expansion will again depend on the compiler, and also on the
machine’s instruction set.
The first level cache of the RISC processors is also a disadvantage of
the RISC, in which these processors have large memory caches on the
chip itself. For feeding the instructions, they require very fast memory
systems.
03/12/2024 30
B.. CISC Processor: CISC stands for Complex Instruction Set Computer. It is
designed to minimize the number of instructions per program, ignoring the
number of cycles per instruction. The emphasis is on building complex
instructions directly into the hardware.
The compiler has to do very little work to translate a high-level language into
assembly level language/machine code because the length of the code is relatively
short, so very little RAM is required to store the instructions.
Some of the CISC Processors are −
IBM 370/168
VAX 11/780
Intel 80486
03/12/2024 31
Architecture of CISC: Its architecture is designed to decrease the memory cost because more storage is needed in
larger programs resulting in higher memory cost. To resolve this, the number of instructions per program can be
reduced by embedding the number of operations in a single instruction.
03/12/2024 32
Characteristics of CISC
Variety of addressing modes.
Larger number of instructions.
Variable length of instruction formats.
Several cycles may be required to execute one instruction.
Instruction-decoding logic is complex.
One instruction is required to support multiple addressing
modes.
03/12/2024 33
Advantages of CISC architecture
Microprogramming is easy assembly language to
implement, and less expensive than hard wiring a
control unit.
The ease of micro coding new instructions allowed
designers to make CISC machines upwardly
compatible:
As each instruction became more accomplished, fewer
instructions could be used to implement a given task.
03/12/2024 34
Disadvantages of CISC architecture
The performance of the machine slows down due to the amount of
clock time taken by different instructions will be dissimilar
Only 20% of the existing instructions is used in a typical
programming event, even though there are various specialized
instructions in reality which are not even used frequently.
The conditional codes are set by the CISC instructions as a side effect
of each instruction which takes time for this setting – and, as the
subsequent instruction changes the condition code bits – so, the
compiler has to examine the condition code bits before this happens
03/12/2024 35
C. Special Processors: These are the processors which are designed
for some special purposes. Few of the special processors are briefly
discussed −
Coprocessor: A coprocessor is a specially designed microprocessor,
which can handle its particular function many times faster than the
ordinary microprocessor.
For example − Math Coprocessor.
Some Intel math-coprocessors are −
8087-used with 8086
80287-used with 80286
80387-used with 80386
03/12/2024 36
Microprocessor - 8085 Architecture
8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit
microprocessor designed by Intel in 1977 using NMOS (m-channel metal-oxide
semiconductor) technology.
It has the following configuration −
8-bit data bus
16-bit address bus, which can address up to 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
It is used in washing machines, microwave ovens, mobile phones, etc.
03/12/2024 37
8085 Microprocessor – Functional Units
8085 consists of the following functional units −
Accumulator
It is an 8-bit register used to perform arithmetic, logical, I/O & LOAD/STORE operations. It is
connected to internal data bus & ALU.
Arithmetic and logic unit
As the name suggests, it performs arithmetic and logical operations like Addition, Subtraction,
AND, OR, etc. on 8-bit data.
General purpose register
There are 6 general purpose registers in 8085 processor, i.e. B, C, D, E, H & L. Each register
can hold 8-bit data. These registers can work in pair to hold 16-bit data and their pairing
combination is like B-C, D-E & H-L.
03/12/2024 38
Program counter: It is a 16-bit register used to store the
memory address location of the next instruction to be executed.
Microprocessor increments the program whenever an
instruction is being executed, so that the program counter points
to the memory address of the next instruction that 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
03/12/2024
data of arithmetic and logical operations. 39
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)
Instruction registers and decoder: It is an 8-bit register. When an instruction is
fetched from memory then it is stored in the Instruction register. Instruction
decoder decodes the information present in the Instruction register.
03/12/2024 40
Timing and control unit: It provides timing and control signal to the
microprocessor to perform operations. Following are the timing and control
signals, which control external and internal circuits −
Control Signals: READY, RD’, WR’, ALE
Status Signals: S0, S1, IO/M’
DMA Signals: HOLD, HLDA
RESET Signals: RESET IN, RESET OUT
Interrupt control: As the name suggests it controls the interrupts during a
process. When a microprocessor is executing a main program and whenever 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.
03/12/2024 41
There are 5 interrupt signals in 8085 microprocessors: INTR, RST 7.5, RST 6.5,
RST 5.5, TRAP.
Serial Input/output control: It controls the serial data communication by using
these two instructions: SID (Serial input data) and SOD (Serial output data).
Address buffer and address-data buffer: The content stored in the stack pointer
and program counter is loaded into the address buffer and address-data buffer to
communicate with the CPU. The memory and I/O chips are connected to these
buses; the CPU can exchange the desired data with the memory and I/O chips
Address bus and data bus: Data bus carries the data to be stored. It is
bidirectional, whereas address bus carries the location to where it should be
stored, and it is unidirectional. It is used to transfer the data & Address I/O
devices
03/12/2024 42
8085 Architecture: We have tried to depict the architecture of 8085 with this following image −
03/12/2024 43
Microprocessor - 8085 Pin Configuration: The following image depicts the pin diagram of 8085
Microprocessor
03/12/2024 44
The pins of 8085 microprocessor can be classified into seven groups:-
i. Address bus: A15-A8, it carries the most significant 8-bits of memory/IO address.
ii. Data bus: AD7-AD0, it carries the least significant 8-bit address and data bus.
iii.Control and status signals: These signals are used to identify the nature of operation. There
are 3 control signal and 3 status signals.
Three control signals are RD, WR & ALE.
RD − This signal indicates that the selected IO or memory device is to be read and is ready
for accepting data available on the data bus.
WR − This signal indicates that the data on the data bus is to be written into a selected
memory or IO location.
ALE − It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes down it
indicates data.
03/12/2024 45
Three status signals are IO/M, S0 & S1.
IO/M: This signal is used to differentiate between IO and Memory operations, i.e.
when it is high indicates IO operation and when it is low then it indicates memory
operation.
S1 & S0: These signals are used to identify the type of current operation.
iv. Power supply: There are 2 power supply signals − VCC & VSS. VCC
indicates +5v power supply and VSS indicates ground signal.
v. Clock signals: There are 3 clock signals, i.e. X1, X2, CLK OUT.
X1, X2 − A crystal (RC, LC N/W) is connected at these two pins and is used to
set frequency of the internal clock generator. This frequency is internally
divided by 2.
CLK OUT − This signal is used as the system clock for devices connected
with the microprocessor.
03/12/2024 46
vi. Interrupts & externally initiated signals:
Interrupts are the signals generated by external
devices to request the microprocessor to
perform a task. There are 5 interrupt signals,
i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and
INTR. We will discuss interrupts in detail in
interrupts section.
03/12/2024 47
INTA − It is an interrupt acknowledgment signal.
RESET IN − This signal is used to reset the microprocessor by setting the
program counter to zero.
RESET OUT − This signal is used to reset all the connected devices when the
microprocessor is reset.
READY − This signal indicates that the device is ready to send or receive data.
If READY is low, then the CPU has to wait for READY to go high.
HOLD − This signal indicates that another master is requesting the use of the
address and data buses.
HLDA (HOLD Acknowledge) − It indicates that the CPU has received the
HOLD request and it will relinquish the bus in the next clock cycle. HLDA is
set to low after the HOLD signal is removed.
03/12/2024 48
vii. Serial I/O signals: There are 2 serial signals, i.e.
SID and SOD and these signals are used for serial
communication.
SOD (Serial output data line) − The output SOD is
set/reset as specified by the SIM instruction.
SID (Serial input data line) − The data on this line is
loaded into accumulator whenever a RIM instruction is
executed.
03/12/2024 49
8085 Addressing Modes & Interrupts
Now let us discuss the addressing modes in 8085
Microprocessor.
Addressing Modes in 8085
These are the instructions used to transfer the data from one
register to another register, from the memory to the register, and
from the register to the memory without any alteration in the
content. Addressing modes in 8085 is classified into 5 groups
–
03/12/2024 50
a) Immediate addressing mode: In this mode, the 8/16-bit data is specified in the instruction
itself as one of its operands. For example: MVI K, 20F: means 20F is copied into register
K.
b) Register addressing mode: In this mode, the data is copied from one register to another.
For example: MOV K, B: means data in register B is copied to register K.
c) Direct addressing mode: In this mode, the data is directly copied from the given address to
the register. For example: LDB 5000K: means the data at address 5000K is copied to
register B.
d) Indirect addressing mode: In this mode, the data is transferred from one register to another
by using the address pointed by the register. For example: MOV K, B: means data is
transferred from the memory address pointed by the register to the register K.
e) Implied addressing mode: This mode doesn’t require any operand; the data is specified by
the opcode itself. For example: CMP.
03/12/2024 51
Interrupts in 8085: Interrupts are the signals generated by the external devices to request the microprocessor to
perform a task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
Interrupt are classified into following groups based on their parameter −
Vector interrupt − In this type of interrupt, the interrupt address is known to the processor. For example:
RST7.5, RST6.5, RST5.5, TRAP.
Non-Vector interrupt − In this type of interrupt, the interrupt address is not known to the processor so, the
interrupt address needs to be sent externally by the device to perform interrupts. For example: INTR.
Maskable interrupt − In this type of interrupt, we can disable the interrupt by writing some instructions into
the program. For example: RST7.5, RST6.5, RST5.5.
Non-Maskable interrupt − In this type of interrupt, we cannot disable the interrupt by writing some
instructions into the program. For example: TRAP.
Software interrupt − In this type of interrupt, the programmer has to add the instructions into the program to
execute the interrupt. There are 8 software interrupts in 8085, i.e. RST0, RST1, RST2, RST3, RST4, RST5,
RST6, and RST7.
Hardware interrupt − There are 5 interrupt pins in 8085 used as hardware interrupts, i.e. TRAP, RST7.5, RST6.5,
RST5.5, INTA.
03/12/2024 52
Interrupt Service Routine (ISR): A small program or a routine that when
executed, services the corresponding interrupting source is called an ISR.
TRAP: It is a non-maskable interrupt, having the highest priority among all
interrupts. By default, it is enabled until it gets acknowledged. In case of failure, it
executes as ISR and sends the data to backup memory. This interrupt transfers the
control to the location 0024H.
RST7.5: It is a maskable interrupt, having the second highest priority among all
interrupts. When this interrupt is executed, the processor saves the content of the
PC register into the stack and branches to 003CH address.
RST 6.5: It is a maskable interrupt, having the third highest priority among all
interrupts. When this interrupt is executed, the processor saves the content of the
PC register into the stack and branches to 0034H address.
03/12/2024 53
RST 5.5: It is a maskable interrupt. When this interrupt is executed, the processor
saves the content of the PC register into the stack and branches to 002CH address.
INTR: It is a maskable interrupt, having the lowest priority among all interrupts.
It can be disabled by resetting the microprocessor.
When INTR signal goes high, the following events can occur −
The microprocessor checks the status of INTR signal during the execution of
each instruction.
When the INTR signal is high, then the microprocessor completes its current
instruction and sends active low interrupt acknowledge signal.
When instructions are received, then the microprocessor saves the address of
the next instruction on stack and executes the received instruction.
03/12/2024 54
Microprocessor - 8085 Instruction Sets: Let us take a look at the programming of 8085
Microprocessor. Instruction sets are instruction codes to perform some tasks. It is classified into
five categories
1. Control Instructions: These types of instructions control machine functions such as Halt, Interrupt, or do
nothing. This type of instructions alters the different type of operations executed in the processor. It is used
when no operation is performed.
2. Logical Instructions: Logical instructions are the instructions which perform basic logical operations
such as AND, OR, etc. In 8085 microprocessors, the destination operand is always the accumulator. Here
logical operation works on a bitwise level
3. Branching Instructions: 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)
4. Arithmetic Instructions: The arithmetic instructions define the set of operations performed by the
processor Arithmetic Logic Unit (ALU). The arithmetic instructions are further classified into binary,
decimal, logical, shift/rotate, and bit/byte manipulation instructions
5. Data Transfer Instructions: Data transfer instructions are the instructions which transfers data in the
microprocessor. They are also called copy instructions. Following is the table showing the list of logical
instructions: OPCODE. OPERAND.
03/12/2024 55
8085 – Example Programs
Now, let us take a look at some program demonstrations using the above
instructions −
Adding Two 8-bit Numbers
Write a program to add data at 3005H & 3006H memory location and store the
result at 3007H memory location.
Problem Example:
(3005H) = 14H
(3006H) = 89H
Result −
14H + 89H = 9DH
03/12/2024 56
The program code can be written like this:
LXI H 3005H : "HL points 3005H"
MOV A, M : "Getting first operand"
INX H : "HL points 3006H"
ADD M : "Add second operand"
INX H : "HL points 3007H"
MOV M, A : "Store result at 3007H"
HLT : "Exit program"
03/12/2024 57
Exchanging the Memory Locations
Write a program to exchange the data at 5000M & 6000M memory
location.
LDA 5000M : "Getting the contents at5000M location into
accumulator"
MOV B, A : "Save the contents into B register"
LDA 6000M : "Getting the contents at 6000M location into
accumulator"
STA 5000M : "Store the contents of accumulator at address 5000M"
MOV A, B : "Get the saved contents back into A register"
STA03/12/2024
6000M : "Store the contents of accumulator at address 6000M"
58
Arrange Numbers in an Ascending Order
Write a program to arrange first 10 numbers from memory address 3000H in an
ascending order.
MVI B, 09 :"Initialize counter"
START :"LXI H, 3000H: Initialize memory pointer"
MVI C, 09H :"Initialize counter 2"
BACK: MOV A, M :"Get the number"
INX H :"Increment memory pointer"
CMP M :"Compare number with next number"
JC SKIP :"If less, don’t interchange"
JZ SKIP :"If equal, don’t interchange"
03/12/2024 59
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H :"Interchange two numbers"
SKIP:DCR C :"Decrement counter 2"
JNZ BACK :"If not zero, repeat"
DCR B :"Decrement counter 1"
JNZ START
HLT :"Terminate program execution"
03/12/2024 60
Microprocessor - 8086 Interrupts
Interrupt is the method of creating a temporary
halt during program execution and allows
peripheral devices to access the microprocessor.
The microprocessor responds to that interrupt with
an ISR (Interrupt Service Routine), which is a short
program to instruct the microprocessor on how to
handle the interrupt.
03/12/2024 61
The following image shows the types of interrupts we have in a 8086
microprocessor −
03/12/2024 62
In terms of market share, Intel has ranked as the number one
maker of microprocessors for
non-embedded systems for decades, a position it seems unlikely
to yield. Interestingly, as
microprocessors have grown faster and much more complex,
Intel has actually picked up the pace.
Intel used to develop microprocessors one after another, every
four years.
It is worthwhile to list some of the highlights of the evolution of
the Intel product line:
03/12/2024 63
8080: The world’s first general-purpose microprocessor. This was an 8-bit
machine, with an
8-bit data path to memory. The 8080 was used in the first personal computer,
the Altair.
8086: A far more powerful, 16-bit machine. In addition to a wider data path and
larger
registers, the 8086 sported an instruction cache, or queue, that prefetches a few
instructions before they are executed. A variant of this processor, the 8088,
was used in IBM’s first personal computer, securing the success of Intel. The
8086 is the first appearance of the x86 architecture.
80286: This extension of the 8086 enabled addressing a 16-MByte memory
instead of just 1 MByte
03/12/2024 64
80386: Intel’s first 32-bit machine, and a major overhaul of the
product. With a 32-bit architecture, the 80386 rivaled the complexity
and power of minicomputers and mainframes introduced just a few
years earlier. This was the first Intel processor to support
multitasking, meaning it could run multiple programs at the same
time.
80486: The 80486 introduced the use of much more sophisticated
and powerful cache technology and sophisticated instruction
pipelining. The 80486 also offered a built-in math coprocessor,
offloading complex math operations from the main CPU
03/12/2024 65
Following Intel's previous 486 series, which offers faster and more efficient
computing, followed the Pentium CPUs. They were among the first to support
cutting-edge capabilities such as MMX technology, which improves multimedia
and graphics performance, and superscalar architecture, which enables the
processing of many instructions at once.
Generations of Pentium Processors
The five generations of Pentium processors are-
Pentium (Original)
Pentium Pro
Pentium II
Pentium III
Pentium 4
03/12/2024 66
Pentium (Original)
The 1993 Pentium processor had the capacity to execute
several instructions per clock cycle. It revolutionized Intel's
microprocessor technology.
With 60 MHz and 66 MHz clock rates, 3.1 million transistors,
and 32-bit processing. It had 8 KB of data and instruction
caches.
It provided better performance than its predecessor, the 486,
with dual pipelines, that allow it to process two instructions
simultaneously.
03/12/2024 67
Pentium Pro
A 1995 Pentium Pro was released. The new P6
microarchitecture was used for high-end servers and
workstations.
There were 5.5 million transistors, 150 MHz to 200
MHz clock speeds, and 256 KB to 1 MB L2 cache.
Its superior branch prediction and out-of-order
execution increase performance.
03/12/2024 68
Pentium II
For desktops and entry-level servers, the 1997 Pentium II enhanced
upon the P6 microarchitecture.
Running between 233 and 450 MHz, it had 7.5 million transistors
and an external L2 cache of 512 KB or 1 MB.
It included MMX technology for better multimedia processing and
improved 3D graphics. It used a Slot 1 SECC package,
differentiating it from earlier models.
03/12/2024 69
Pentium III
This was published in 1999. Pentium III improved P6
microarchitecture performance by adding new features.
It has clock speeds ranged from 450 MHz to 1.4 GHz, with 9.5
million transistors and SSE (Streaming SIMD Extensions) for better
multimedia performance.
It improved Internet and 3D capabilities, better floating-point
performance, and it used a more efficient 0.18-micron manufacturing
process.
03/12/2024 70
Pentium 4
It was released in 2000. With the new NetBurst microarchitecture, the
Pentium 4 was able to run at faster speeds and with better
performance.
It's initial models started at 1.3 GHz and went up to 3.8 GHz. It had a
20-stage pipeline and later versions included Hyper-Threading
technology.
It introduced the LGA 775 socket and supported DDR2 memory.
Known for its deep pipeline architecture allowing higher clock
speeds, but it also had high power consumption and heat output.
03/12/2024 71
Core: This is the first Intel x86 microprocessor with a
dual core, referring to the
implementation of two processors on a single chip.
03/12/2024 73