MICprocessor Unit 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

MICROPROCESSOR

UNIT 1
INTRODUCTION TO 80386
GUIDED BY: PROF. M. S. SHELAR

……EDITED BY: MS. A.K. MATALE


Architecture of Intel’s 80486 Microprocessor:
1. INTRODUCTION TO MICROPROCESSOR

• A microprocessor is a computer
processor for which the data
processing logic and control is
included on a single integrated circuit
(IC), or a small number of ICs.
• The microprocessor contains the
arithmetic, logic, and control circuitry
required to perform the functions of a
computer's central processing unit
(CPU).
• Block diagram of microprocessor is as
shown
2. HISTORY OF MICROPROCESSOR
• Many more microprocessors are part of embedded
systems, providing digital control over myriad objects
from appliances to automobiles to cellular
phones and industrial process control.
• Microprocessors perform binary operations based
on Boolean logic, named after George Boole. The PICO1/GI250 chip introduced in 1971: It was designed by
Pico Electronics (Glenrothes, Scotland) and manufactured by
• The ability to operate computer systems using General Instrument of Hicksville NY.

Boolean Logic was first proven in a 1938.


• By master's student Claude Shannon, who later went
on to become a professor. Shannon is considered
• "The Father of Information Theory".
• In 1951 Microprogramming was invented by Maurice
Wilkes at the University of Manchester, UK.
INTEL 4004

THE INTEL 4004 IS OFTEN (FALSELY) REGARDED AS THE FIRST TRUE


MICROPROCESSOR BUILT ON A SINGLE CHIP.

THE CLAIM OF BEING THE FIRST IS DEFINITELY FALSE,.


THE EARLIER TMS1802NC WAS ALSO A TRUE MICROPROCESSOR BUILT ON A
SINGLE CHIP
THE SAME APPLIES FOR THE - PROTOTYPE ONLY - 8-BIT TMX 1975.

THE FIRST KNOWN ADVERTISEMENT FOR THE 4004 IS DATED NOVEMBER 15,
1971.

The 4004 with cover removed (left) and as actually


used (right)
Evaluation of Microprocessor:
1). First Generation (4 - bit Microprocessors)
• The first generation microprocessors were introduced in the year 1971-1972.
• It was named Intel 4004 since it was a 4-bit processor.
2). Second Generation (8 - bit Microprocessor)
• The second generation microprocessors were introduced in 1973.
• It was a first 8 - bit microprocessor which could perform arithmetic and logic
operations on 8-bit words.
• It was Intel 8008, and another improved version was Intel 8088.
3). Third Generation (16 - bit Microprocessor)
• The third generation microprocessors, introduced in 1978 .8086, Zilog Z800
and 80286, which were 16 - bit processors with a performance like
.

4). Third Generation (16 - bit Microprocessor)


The third generation microprocessors, introduced in 1978 were represented by Intel's
8086, Zilog Z800 and 80286, which were 16 - bit processors with a performance like
minicomputers.

5). Fifth Generation (64 - bit Microprocessors)


From 1995 to now we are in the fifth generation. After 80856, Intel came out with a new
processor namely Pentium processor followed by Pentium Pro CPU, which allows
multiple CPUs in a single system to achieve multiprocessing.
Other improved 64-bit processors are Celeron, Dual, Quad, Octa Core processors.
Table: Important Intel
Microprocessors
Microprocessor Year of Word Memory addressing Clock Remarks
Pins
Invention Length Capacity
4004 1971 4-bit 1 KB 16 750 KHz First
Microprocessor
8085 1976 8-bit 64 KB 40 3-6 MHz Popular 8-bit
Microprocessor
8086 1978 16-bit 1MB 40 5-8 MHz Widely used in
PC/XT
80286 1982 16-bit 16MB real, 4 GB 68 6-12.5 MHz Widely used in
virtual PC/AT
80386 1985 32-bit 4GB real, 64TB 132 14X14 20-33 MHz Contains MMU on
virtual PGA chip
80486 1989 32-bit 4GB real, 64TB 168 17X17 25-100 MHz Contains MMU,
virtual PGA cache and FPU,
1.2 million
transistors
Pentium 1993 32-bit 4GB real,32- 237 PGA 60-200 Contains 2
bit ALUs,2 Caches,
address,64- FPU, 3.3 Million
bit data bus transistors, 3.3
V, 7.5 million
transistors
Pentium 1995 32-bit 64GB real, 387 PGA 150-200 It is a data flow
Pro 36-bit MHz processor. It
address bus contains second
level cache
also,3.3 V
Pentium 1997 32-bit - - 233-400 All features
II MHz Pentium pro
plus MMX
technology,3.3
V, 7.5 million
transistors
Pentium II 1997 32-bit - - 233-400 MHz All features Pentium
pro plus MMX
technology,3.3 V, 7.5
million transistors

Pentium III 1999 32-bit 64GB 370 PGA 600-1.3 MHz Improved version of
Pentium II; 70 new
SIMD instructions
•PGA - Pin Grid Array

•MMX - Multimedia extensions

•EPIC - Explicitly Parallel Instruction Computing

•SIMD - Single Instruction Multiple Data

•ALU - Arithmetic and Logic Unit

•MMU - Memory Management Unit

•FPU - Floating Point Unit


Basic Terms used in Microprocessor:
Here is a list of some basic terms used in microprocessor:

Instruction Set - The group of commands that the microprocessor can understand is called
Instruction set. It is an interface between hardware and software.

Bus - Set of conductors intended to transmit data, address or control information to different
elements in a microprocessor. A microprocessor will have three types of buses, i.e., data bus,
address bus, and control bus.
IPC (Instructions Per Cycle) - It is a measure of how many instructions a CPU is capable of
executing in a single clock.

Clock Speed - It is the number of operations per second the processor can perform. It can be
expressed in megahertz (MHz) or gigahertz (GHz). It is also called the Clock Rate.

Data Types - The microprocessor supports multiple data type formats like binary, ASCII, signed
and unsigned numbers.
Working of Microprocessor:
• The microprocessor follows a sequence to execute the instruction: Fetch, Decode,
and then Execute.
• Initially, the instructions are stored in the storage memory of the computer in
sequential order.

• The microprocessor fetches those instructions from the stored area (memory), then
decodes it and executes those instructions till STOP instruction is met.

• Then, it sends the result in binary form to the output port. Between these
processes, the register stores the temporary data and ALU (Arithmetic and Logic
Unit) performs the computing functions.
MICROPROCESSOR 5). LOW POWER CONSUMPTION - MICROPROCESSORS
ARE USING METAL OXIDE SEMICONDUCTOR
TECHNOLOGY,.
1). LOW COST - DUE TO INTEGRATED CIRCUIT
TECHNOLOGY 6). LESS HEAT GENERATION - MICROPROCESSORS
MICROPROCESSORS ARE AVAILABLE AT VERY LOW USES SEMICONDUCTOR TECHNOLOGY WHICH WILL NOT
COST. IT WILL REDUCE THE COST OF A COMPUTER EMIT MUCH HEAT AS COMPARED TO VACUUM TUBE
SYSTEM. DEVICES.

2). HIGH SPEED - DUE TO THE TECHNOLOGY INVOLVED 7). RELIABLE - SINCE MICROPROCESSORS USE
IN IT, THE MICROPROCESSOR CAN WORK AT VERY HIGH SEMICONDUCTOR TECHNOLOGY, THEREFORE, THE
SPEED. IT CAN EXECUTE MILLIONS OF INSTRUCTIONS FAILURE RATE IS VERY LESS. HENCE IT IS VERY
PER SECOND. RELIABLE.

3).SMALL SIZE - A MICROPROCESSOR IS FABRICATED IN 8). PORTABLE - DUE TO THE SMALL SIZE AND LOW
A VERY LESS FOOTPRINT DUE TO VERY LARGE SCALE. POWER CONSUMPTION MICROPROCESSORS ARE
PORTABLE.
OPERATING MODES OF 80386
MICROPROCESSORS
The Intel 80386 microprocessor, often known as the i386, was a popular x86-based microprocessor.
Its capacity to run in numerous modes, which allowed varied levels of memory management and protection, as
well as backward compatibility with previous processors one of its primary characteristics.

The 80386 Modes of Operation:

1) Real Mode
2) Protected Mode
3) Virtual 8086 Modes
4) System Management Mode

Each mode provided unique features and was


designed for certain use cases, such as running
older applications, advanced memory management,
and system management duties.
EACH MODE PROVIDED UNIQUE FEATURES AND WAS DESIGNED FOR CERTAIN USE
CASES, SUCH AS RUNNING OLDER APPLICATIONS, ADVANCED MEMORY MANAGEMENT,
AND SYSTEM MANAGEMENT DUTIES. UNDERSTANDING THESE OPERATING MODES IS
CRITICAL FOR UNDERSTANDING THE 80386 MICROPROCESSOR’S CAPABILITIES AND
LIMITATIONS, AS WELL AS HOW IT WAS EMPLOYED IN EARLY PERSONAL COMPUTERS
AND SERVERS.
1). Real Mode:

• When the 80386 is turned on for the first time, the Real
mode is its default operating mode.
• Software created for the 8086 and 8088 processors will
work on the 80386 without needing to be modified
because it is fully backward-compatible with these older
CPUs.
• The 80386 has a 20-bit address space in Real mode,
giving it access to 1MB of memory.
• The memory is separated into 64K segments, and a
16-bit segment register can be used to access each
section.
• The processor uses segment-based memory
addressing while operating in this mode and is not
given access to sophisticated memory management
and security functions.
• Real mode likewise has a constrained set of
instructions and does not support protected or virtual
memory.
2). Protected Mode:

• A 32-bit address space is available in protected


mode, a sophisticated operating mode that gives
users access to up to 4GB of memory.
• Additionally, it offers sophisticated memory
management and security features including
segmentation and paging. Pages are fixed-size
units of memory that can be moved in and out of
physical memory as needed.
• Paging enables this.
• Memory can be separated into logical units called
segments through segmentation, which can be
used to restrict access to particular memory
locations.
3). Virtual 8086 Modes:

• The 80386 may operate numerous virtual environments that are


compatible with the 8086 simultaneously in virtual 8086 modes.

• Although they share the same physical memory, each virtual


environment has its own set of registers and memory space.

• This mode enables the 80386 to mimic the actions of an 8086


processor, which is frequently used to run older applications on more
modern computers.

• The 80386 may move between many virtual environments as needed


thanks to the system for handling interrupts and exceptions that are
provided by virtual 8086 modes.

• The virtual 8086 mode allows for the simultaneous operation of


numerous virtual machines without interfering with one another while
simulating the behavior of a real 8086 CPU in a protected virtual
memory environment.
Memory
Operating Mode Address Space Management Backward Compatibility
Features

Fully compatible with


Real Mode 20-bit None
8086/8088 processors

Segmentation, paging, Partial compatibility with


Protected Mode 32-bit
privileged instructions 8086/8088 processors

20-bit (per virtual Virtualization of 8086 Fully compatible with


Virtual 8086 Mode
machine) environment 8086/8088 processors
Applications Instruction Set

1. Data Movement Instructions.


2. Binary Arithmetic Instructions.
3. Decimal Arithmetic Instruct
4. Logical Instructions.
5. Control Transfer Instructions.
6. String and Character Translation
Instructions.
7. Instructions for Block-Structured
Languages.
Arithmetic Instructions in the 80386 Microprocessor

Below mentioned are the arithmetic instructions that are in the 80386 Micro-Processor.

1. Floating-Point Arithmetic Instructions

The 80386 chip offers help for drifting point math tasks, which are utilized for working with numbers that
have a fragmentary part. The FADD, FSUB, FMUL, FDIV, FCOM, FCOMP, and FLD guidelines are
utilized for drifting point number-crunching activities.

2. Extended Addition and Subtraction

The 80386 chip gives extra guidelines to broadened expansion and deduction activities. The ADC and
SBB guidelines are utilized for adding or taking away qualities alongside the convey or acquire banners.
These guidelines are helpful in performing number-crunching procedures on multi-accuracy numbers.
3. Extended Multiplication and Division

• The 80386 chip gives extra Instructions to broadened augmentation and division tasks.

• The IMUL guidance is utilized for marked augmentation, while the MUL guidance is utilized for unsigned
increases. Also, the IDIV guidance is utilized for marked division, and the DIV guidance is utilized for
unsigned division.

4. Bit Field Control Instructions

• The 80386 chip gives Instructions to bit field control, which permits individual pieces or gatherings of pieces
to be removed, adjusted, or joined.

• The BT, BTC, BTR, BTS, and SETcc Instructions are utilized for bit field control.

5. String Instructions

• The 80386 chip gives Instructions to string control, which can be utilized for procedures on varieties of
bytes or words.

• The MOVSB, MOVSW, CMPSB, CMPSW, STOSB, and STOSW Instructions are utilized for string
activities.
6. Bit Sweep Instructions

• The 80386 microchip gives Instructions to bit check tasks, which are utilized for tracking down the place of the
first or last set piece in a word or double word.

• The BSF and BSR guidelines are utilized for digit filter activities.

7. Decimal Arithmetic Instructions

• The 80386 chip offers help for decimal math tasks, which are utilized for working with numbers in decimal
configuration.

• The DAA, DAS, AAA, and AAS guidelines are utilized for decimal number juggling activities.

8. SIMD (Single Guidance Various Information) Instructions

• The 80386 chip offers help for SIMD activities, which permit numerous information things to be handled at the
same time.

• The MMX Instructions are utilized for SIMD activities.

• These guidelines have extraordinarily extended the abilities of microchips and have made them more flexible
and proficient.
Instruction type Description

Floating-Point Arithmetic FADD, FSUB, FMUL, FDIV, FCOM, FCOMP, FLD

Extended Addition and Subtraction ADC, SBB

Extended Multiplication and Division IMUL, MUL, IDIV, DIV

Bit Field Manipulation BT, BTC, BTR, BTS, SETcc

String Operations MOVSB, MOVSW, CMPSB, CMPSW, STOSB, STOSW

Bit Scan Operations BSF, BSR

Decimal Arithmetic DAA, DAS, AAA, AAS

SIMD Operations MMX


Instruction to transfer a word

•MOV − Used to copy the byte or word from the provided source to
the provided destination.

•PPUSH − Used to put a word at the top of the stack.

•POP − Used to get a word from the top of the stack to the
provided location.

•PUSHA − Used to put all the registers into the stack.

•POPA − Used to get words from the stack to all registers.

•XCHG − Used to exchange the data from two locations.

•XLAT − Used to translate a byte in AL using a table in the memory.


Instructions for input and output port transfer

•IN − Used to read a byte or word from the provided


port to the accumulator.

•OUT − Used to send out a byte or word from the


accumulator to the provided port.
Instructions to transfer the address

•LEA − Used to load the address of operand into the provided register.

•LDS − Used to load DS register and other provided register from the memory

•LES − Used to load ES register and other provided register from the memory.
Instructions to transfer flag registers
•LAHF − Used to load AH with the low byte of the
flag register.
•SAHF − Used to store AH register to low byte of
the flag register.
•PUSHF − Used to copy the flag register at the top
of the stack.
•POPF − Used to copy a word at the top of the
stack to the flag register.
Instructions to perform addition
•ADD − Used to add the provided byte to
byte/word to word.
•ADC − Used to add with carry.
•INC − Used to increment the provided byte/word
by 1.
•AAA − Used to adjust ASCII after addition.
•DAA − Used to adjust the decimal after the
addition/subtraction operation.
Instructions to perform subtraction
•SUB − Used to subtract the byte from byte/word
from word.
•SBB − Used to perform subtraction with borrow.
•DEC − Used to decrement the provided byte/word
by 1.
•NPG − Used to negate each bit of the provided
byte/word and add 1/2’s complement.
•CMP − Used to compare 2 provided byte/word.
•AAS − Used to adjust ASCII codes after
subtraction.
•DAS − Used to adjust decimal after subtraction.
Instruction to perform multiplication
•MUL − Used to multiply unsigned byte by
byte/word by word.
•IMUL − Used to multiply signed byte by byte/word
by word.
•AAM − Used to adjust ASCII codes after
multiplication.
Instructions to perform division

•DIV − Used to divide the unsigned word by byte or unsigned double word by word.

•IDIV − Used to divide the signed word by byte or signed double word by word.

•AAD − Used to adjust ASCII codes after division.


•CBW − Used to fill the upper byte of the word with the copies of sign bit of the lower
byte.

•CWD − Used to fill the upper word of the double word with the sign bit of the lower
word.
Instructions to perform logical operation

•NOT − Used to invert each bit of a byte or word.

•AND − Used for adding each bit in a byte/word with the corresponding bit in
another byte/word.

•OR − Used to multiply each bit in a byte/word with the corresponding bit in
another byte/word.

•XOR − Used to perform Exclusive-OR operation over each bit in a byte/word


with the corresponding bit in another byte/word.

•TEST − Used to add operands to update flags, without affecting operands .


Instructions to perform shift operations

•SHL/SAL − Used to shift bits of a byte/word towards left


and put zero(S) in LSBs.

•SHR − Used to shift bits of a byte/word towards the right


and put zero(S) in MSBs.

•SAR − Used to shift bits of a byte/word towards the right


and copy the old MSB into the new MSB.
Instructions to perform rotate operations

•ROL − Used to rotate bits of byte/word towards the left,


i.e. MSB to LSB and to Carry Flag [CF].

•ROR − Used to rotate bits of byte/word towards the right,


i.e. LSB to MSB and to Carry Flag [CF].

•RCR − Used to rotate bits of byte/word towards the right,


i.e. LSB to CF and CF to MSB.

•RCL − Used to rotate bits of byte/word towards the left, i.e.


MSB to CF and CF to LSB.
the byte/word from one string to another.
String Instructions
• COMS/COMPSB/COMPSW − Used to
compare two string bytes/words.
String is a group of bytes/words and their
memory is always allocated in a sequential •INS/INSB/INSW − Used as an input
order. string/byte/word from the I/O port to the
provided memory location.
Following is the list of instructions under
this group − • OUTS/OUTSB/OUTSW − Used as an
•REP − Used to repeat the given output string/byte/word from the provided
instruction till CX ≠ 0. memory location to the I/O port.

•REPE/REPZ − Used to repeat the given • SCAS/SCASB/SCASW − Used to scan a


instruction until CX = 0 or zero flag ZF = string and compare its byte with a byte in
1. AL or string word with a word in AX.
•REPNE/REPNZ − Used to repeat the given
instruction until CX = 0 or zero flag ZF = • LODS/LODSB/LODSW − Used to store the
1. string byte into AL or string word into AX.
•MOVS/MOVSB/MOVSW − Used to move
Instructions to transfer the instruction during an
execution without any condition −

•CALL − Used to call a procedure and save their return address to the stack.
•RET − Used to return from the procedure to the main program.
•JMP − Used to jump to the provided address to proceed to the next instruction.
Instructions to transfer the instruction during an execution with some
conditions −

•JA/JNBE − Used to jump if above/not below/equal instruction satisfies.


•JAE/JNB − Used to jump if above/not below instruction satisfies.
•JBE/JNA − Used to jump if below/equal/ not above instruction satisfies.
•JC − Used to jump if carry flag CF = 1
•JE/JZ − Used to jump if equal/zero flag ZF = 1
•JJG/JNLE − Used to jump if greater/not less than/equal instruction satisfies.
•GE/JNL − Used to jump if greater than/equal/not less than instruction satisfies.
•JL/JNGE − Used to jump if less than/not greater than/equal instruction satisfies.
•JLE/JNG − Used to jump if less than/equal/if not greater than instruction satisfies.
•JNC − Used to jump if no carry flag (CF = 0)
•JNE/JNZ − Used to jump if not equal/zero flag ZF = 0
•JNO − Used to jump if no overflow flag OF = 0
•JNP/JPO − Used to jump if not parity/parity odd PF = 0
•JJG/JNLE − Used to jump if greater/not less than/equal instruction satisfies.
•GE/JNL − Used to jump if greater than/equal/not less than instruction satisfies.
•JL/JNGE − Used to jump if less than/not greater than/equal instruction satisfies.
•JLE/JNG − Used to jump if less than/equal/if not greater than instruction satisfies.
•JNC − Used to jump if no carry flag (CF = 0)
•JNE/JNZ − Used to jump if not equal/zero flag ZF = 0
•JNO − Used to jump if no overflow flag OF = 0
•JNP/JPO − Used to jump if not parity/parity odd PF = 0
•JNS − Used to jump if not sign SF = 0
•JO − Used to jump if overflow flag OF = 1
•JP/JPE − Used to jump if parity/parity even PF = 1
•JS − Used to jump if sign flag SF = 1
Processor Control Instructions

These instructions are used to control the processor action by setting/resetting the
flag values.
Following are the instructions under this group −

•STC − Used to set carry flag CF to 1

•CLC − Used to clear/reset carry flag CF to 0

•CMC − Used to put complement at the state of carry flag CF.

•STD − Used to set the direction flag DF to 1

•CLD − Used to clear/reset the direction flag DF to 0

•STI − Used to set the interrupt enable flag to 1, i.e., enable INTR input.

•CLI − Used to clear the interrupt enable flag to 0, i.e., disable INTR input.
Interrupt Instructions

These instructions are used to call the interrupt during program execution.

•INT − Used to interrupt the program during execution and calling service specified.

•INTO − Used to interrupt the program during execution if OF = 1

•IRET − Used to return from interrupt service to the main program


Flag Manipulation and Processor Control Instructions

Instructions of this instruction set are related to flag


manipulation and machine control.
1.CLC --- Clear carry flag.

2.CMC --- Complement Carry flag.

3.STC --- Set Carry Flag.

4.CLD --- Clear Direction Flag.

5.SDF --- Set Direction Flag.

6.CLI --- Clear Interrupt Flag.

7.STI --- Set Interrupt Flag Machine control instructions.

8.HLT ---- Halt the process


MISCELLANEOUS INSTRUCTIONS:
…………………..Thank you……………….

You might also like