SlideShare une entreprise Scribd logo
1  sur  67
By
Vijay Kumar. K
Asst. Professor
Dept. of ECE
 When your phone rings during a lecture, what will happen?
 When you are studying then your cell phone rings – what will you do?
When you finish talking on the phone then you will continue with
your study
 Now your phone rings again and someone also knocking at your door
then what will you do?
When being interrupted, you will perform some pre-defined action
Interrupt has priority – some interrupt is more important than the
others. For example, asking your phone is more important than opening
the door
Introduction
 An interrupt is used to cause a temporary halt in the execution of
program.
 The meaning of ‘interrupts’ is to break the sequence of operation.
 While the Microprocessor is executing a program, an ‘interrupt’
breaks the normal sequence of execution of instructions, diverts
its execution to some other program called Interrupt Service
Routine (ISR).
After executing ISR, IRET returns the control back again to
the main program. Interrupt processing is an alternative to
polling.
Need for Interrupt:
Interrupts are particularly useful when interfacing I/O
devices, that provide or require data at relatively low data
transfer rate.
Three types of interrupts sources are there:
1. An external signal applied to NMI or INTR input pin( hardware
interrupt)
2. Execution of Interrupt instruction( software interrupt)
3. Interrupt raised due to some error condition produced in 8086
instruction execution process. ( divide by zero, overflow errors
etc)
Sources of Interrupts:
Use of interrupt
How to get key typed in the keyboard or a keypad?
 Polling :-
The CPU executes a program that check for the available of
data If a key is pressed then read the data, otherwise keep waiting
or looping!!!
 Interrupt:-
The CPU executes other program, as soon as a key is pressed,
the Keyboard generates an interrupt. The CPU will response to the
interrupt – read the data. After that returns to the original program.
So by proper use of interrupt, the CPU can serve many devices at the
“same time”
Polling Vs Interrupt
The keyboard controller can hold only a single keystroke.
Therefore, the keyboard controller must be freed before the next
keystroke arrives.
The keystroke is passed to the CPU by putting it in the
keyboard buffer. So, the keyboard controller keeps on passing the
keystroke input to the CPU,
but how does the CPU attend to it?
The CPU is not at the disposal of the keyboard controller; it is
usually busy doing several other operations. So, we need
some mechanism to indicate to the CPU that a keystroke has
arrived. How is this done? There are two approaches to making
sure that the CPU pays attention:
Polling-based
Interrupt-based
Example: Polling Vs Interrupt
Keystroke causes interrupt
Figure 2: Polling-based interrupt handling
Polling
 The CPU executes a program that check for the
available of data If a key is pressed then read the data,
otherwise keep waiting or looping!!!
Keystroke passed to the CPU
No keystroke for CPU
Interrupt-based approach
Interrupt-based systems
 The CPU executes other program, as soon as a key is
pressed, the Keyboard generates an interrupt. The CPU
will response to the interrupt – read the data. After
that returns to the original program. So by proper use
of interrupt, the CPU can serve many devices at the
“same time”
Example of interrupt
 How to control a robot that has sensors to detect
obstacles and makes a turn
Controlling a robot by using Polling & Interrupt
 Interrupt
 Keeping moving until interrupted by the sensor
 Interrupt received then do pre-defined operation
 After finishing the interrupt service return to normal
operation i.e keep moving forward again
 Polling
 Move forward in a pre-defined unit
 Check sensor reading
 Do nothing if no obstacle or turn if obstacle detected
 Loop back and move forward again
Polling Vs Interrupt Control of a robot
Move forward
Check sensor
Y
Stop or turn
Move forward
interrupt
N
INTERRUPT VECTOR TABLE
8086 INTERRUPT TYPES
256 INTERRUPTS OF 8086 ARE DIVIDED IN TO 3 GROUPS
1. TYPE 0 TO TYPE 4 INTERRUPTS-
These Are Used For Fixed Operations And Hence Are Called
Dedicated Interrupts
2. TYPE 5 TO TYPE 31 INTERRUPTS
Not Used By 8086,reserved For Higher Processors Like 80286
80386 Etc
3. TYPE 32 TO 255 INTERRUPTS
Available For User, called User Defined Interrupts These Can
Be H/W Interrupts And Activated Through Intr Line Or Can Be
S/W Interrupts.
Type – 0 Divide Error Interrupt
Quotient Is Large Cant Be Fit In Al/Ax Or Divide By Zero
Type –1 Single Step Interrupt
Used For Executing The Program In Single Step Mode By Setting Trap Flag
To Set Trap Flag PUSHF
MOV BP,SP
OR [BP+0],0100H;SET BIT8
POPF
Type – 2 Non Maskable Interrupt
This Interrupt Is Used For Executing Isr Of Nmi Pin (Positive Egde Signal). Nmi
Cant Be Masked By S/W
Type – 3 Break Point Interrupt
Used For Providing Break Points In The Program
Type – 4 Over Flow Interrupt
Used To Handle Any Overflow Error After Signed Arithmetic
PRIORITY OF INTERRUPTS
Interrupt Type Priority
INT0, INT3-INT 255, Highest
NMI(INT2)
INTR
SINGLE STEP Lowest
INT 21h is provided by DOS. When MS-DOS is loaded into the
computer, INT 21H can be invoked to perform some extremely useful
functions. These functions are commonly referred to as DOS INT 21H
function calls. Data input and output through the keyboard and
monitor are the most commonly used functions. Below are two
examples that use DOS interrupts.
1. Display the message defined with variable DATA_ASC DB ‘the
earth is but one country’,’$’
MOV AH,09 ;option 9 to display string of data
MOV DX, OFFSET DATA_ASC ;DX= offset address of data
INT 21H ; invoke the interrupt
2. Inputting a single character, with echo.
MOV AH, 01 ;option 01 to input one character
INT 21H ;invoke the interrupt
DOS interrupts
DOS (Disk Operating System) Interrupts
1. Function Call 01: Read The Key Board
Input Parameter Ah = 01 Read A Character From Keyboard.
Echo It On CRO Screen and Return The ASCII Code Of The Key
Pressed in Al Output Parameter: Al = ASCII Code Of Character
2. Function Call 02h: Display On CRT Screen
Input Parameter: Ah = 02
Dl = ASCII Character To Be Displayed On CRT Screen
3. Function Call 03: Read Character From Com1
Input Parameter: Ah = 03h
Function: Reads Data From Com Port
Output Parameter: Al = ASCII Code Of Character
4. Function Call 04: Write Character To Com1
Input Parameter: Ah = 04h Dl = ASCII Code Of Character To
Be Transmitted
Function: Writes Data To Com Port
DOS INTERRUPTS
5. Function Call 05: Write To Lpt1
Input Parameter: Al = 05H
Dl = Ascii Code Of Character To Be Printted
Function: Print The Character Available In Dl On Printer Attached To Lpt1
6. Function Call 09: Display A Character String
Input Parameter: Ah = 09,ds:dx= Address Of Character String
Function: Displays The Characters Available In The String To Crt Till A $
7. Function Call 0ah: Buffered Key Board Input
Input Parameter: Ah = 0ah
Ds:dx = Address Of Keyboard Input Buffer
Function: The ASCII Codes Of The Characters Received From Keyboard
Are Stored In Keyboard Buffer From 3rd Byte. 1st Byte Of Buffer =
Size Of Buffer Upto 255. It Receives The Characters Till
Specified No.Of Characters Are Received Or Enter Key
Is Presses Which Ever Is Earlier
INT 10H subroutines are burned into the ROM BIOS of the
8086 based and compatibles and are used to communicate with the
computer user screen video. Much of the manipulation of screen text
or graphics is done through INT 10H. Among them are changing the
color of characters or background, clearing screen, and changing the
locations of cursor. Below are two examples that use BIOS interrupts.
1. Clearing the screen:
MOV AX, 0600H ;scroll entire screen
MOV BH, 07 ;normal attribute
MOV CX, 0000 ;start at 00,00
MOV DX, 184FH ;end at 18, 4F
INT 10H ;invoke the interrupt
BIOS interrupt
BIOS (Basic Input/output System) INTERRUPTS
INT 10h:Video Service Interrupt
It Controls The Video Display
(a) Function Call 00: Select Video Mode
Input Parameter: Al = Mode Number
Ah = 00h
Function: It Changes The Display Mode And Clears The Screen
Al = 00 40 X 25 Black And White
Al = 04 320 X 200 Color
Al = 10h 640 X 350 X 16 Color
(b) FUNCTION CALL 03: READ CURSOR POSITION
Input Parameter: Ah = 03
Bh = Page Number
Function: Reads Cursor Position On Screen
Output Parameters: Ch = Starting Line
Cl = Ending Line
Dh = Current Row
Dl = Current Column
BIOS INTERRUPTS
( C) Function Call 0E:Write Character On CRT Screen And Advance Cursor
Input Parameter:Ah = 0eh
Al = ASCII Code Of The Character
Bh = Page(text Mode)
Bl = Color(graphics)
Function: Display Character Available In Al On Screen
INT 11h: Determine The Type Of Equipment Installed. Register Ax Should Contain
FFFFh And Instruction INT 11h To Be Executed. On Return, Register Ax Will
Indicate The Equipments Attached To Computer
INT14h: Control The Serial Communication Port Attached To The Computer. Ah
Should Contain The Function Call
(a) Function Call 00:initialize The Com Port
(b) Function Call 01: Send A Character
(c) Function Call 02:receive A Character
INT 16h: Keyboard Interrupt
Ah Should Contain The Function Call
(a) Function Call 00: Read Keyboard Character, It Will Return Ascii Code Of The
Character
(b) Function Call 01: Get Key Board Status
Understanding interrupts and their uses in 8086 microprocessor

Contenu connexe

Tendances

Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor Mustapha Fatty
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and ArchitectureVinit Raut
 
Subroutine & string in 8086 Microprocessor
Subroutine & string in 8086 MicroprocessorSubroutine & string in 8086 Microprocessor
Subroutine & string in 8086 MicroprocessorMustafa AL-Timemmie
 
8259 Operating Modes.pptx
8259 Operating Modes.pptx8259 Operating Modes.pptx
8259 Operating Modes.pptxMeenaAnusha1
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086asrithak
 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086Ikhlas Rahman
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer KitAmit Kumer Podder
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionBadrul Alam
 
Register of 80386
Register of 80386Register of 80386
Register of 80386aviban
 
Microprocessor 80386
Microprocessor 80386Microprocessor 80386
Microprocessor 80386yash sawarkar
 
8086 in minimum mode
8086 in minimum mode8086 in minimum mode
8086 in minimum modeSridari Iyer
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualyeshwant gadave
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijay8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijayVijay Kumar
 

Tendances (20)

Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and Architecture
 
Interrupts of 8086
Interrupts of 8086Interrupts of 8086
Interrupts of 8086
 
Subroutine & string in 8086 Microprocessor
Subroutine & string in 8086 MicroprocessorSubroutine & string in 8086 Microprocessor
Subroutine & string in 8086 Microprocessor
 
8259 Operating Modes.pptx
8259 Operating Modes.pptx8259 Operating Modes.pptx
8259 Operating Modes.pptx
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086
 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
 
Register of 80386
Register of 80386Register of 80386
Register of 80386
 
Microprocessor 80386
Microprocessor 80386Microprocessor 80386
Microprocessor 80386
 
8086 in minimum mode
8086 in minimum mode8086 in minimum mode
8086 in minimum mode
 
8086 new
8086 new8086 new
8086 new
 
8086 alp
8086 alp8086 alp
8086 alp
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannual
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijay8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijay
 

Similaire à Understanding interrupts and their uses in 8086 microprocessor

Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kVijay Kumar
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdfAkritiPradhan2
 
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardCustomizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardBharat Biyani
 
Direct Memory Access & Interrrupts
Direct Memory Access & InterrruptsDirect Memory Access & Interrrupts
Direct Memory Access & InterrruptsSharmilaChidaravalli
 
CO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptxCO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptxahmedsalik057
 
System concept and hardware
System concept and hardwareSystem concept and hardware
System concept and hardwarefiza1975
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiUnmesh Baile
 
Computer organization part 2
Computer organization part 2Computer organization part 2
Computer organization part 2Hhhh85105
 
Computer architecture presentation
Computer architecture presentationComputer architecture presentation
Computer architecture presentationMuhammad Hamza
 
420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptxddscraft123
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEr. Raju Bhardwaj
 
Computer organization
Computer organizationComputer organization
Computer organizationRvishnupriya2
 
Computer organization
Computer organization Computer organization
Computer organization vishnu973656
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output OrganizationKamal Acharya
 

Similaire à Understanding interrupts and their uses in 8086 microprocessor (20)

Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.k
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardCustomizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
 
Interrupt in 8051
Interrupt in 8051Interrupt in 8051
Interrupt in 8051
 
Direct Memory Access & Interrrupts
Direct Memory Access & InterrruptsDirect Memory Access & Interrrupts
Direct Memory Access & Interrrupts
 
CO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptxCO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptx
 
System concept and hardware
System concept and hardwareSystem concept and hardware
System concept and hardware
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbai
 
I/O Channel IBM 370
I/O Channel IBM 370I/O Channel IBM 370
I/O Channel IBM 370
 
Computer organization part 2
Computer organization part 2Computer organization part 2
Computer organization part 2
 
int 21,16,09 h
int 21,16,09 hint 21,16,09 h
int 21,16,09 h
 
Computer architecture presentation
Computer architecture presentationComputer architecture presentation
Computer architecture presentation
 
Al2ed chapter15
Al2ed chapter15Al2ed chapter15
Al2ed chapter15
 
Al2ed chapter14
Al2ed chapter14Al2ed chapter14
Al2ed chapter14
 
420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower Bot
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Computer organization
Computer organization Computer organization
Computer organization
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 
Interrupts
InterruptsInterrupts
Interrupts
 

Plus de Vijay Kumar

Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Vijay Kumar
 
8086 Microprocessor
8086 Microprocessor 8086 Microprocessor
8086 Microprocessor Vijay Kumar
 
Assembly Language
Assembly LanguageAssembly Language
Assembly LanguageVijay Kumar
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction setVijay Kumar
 
8085 instruction set and addressing modes
8085 instruction set and addressing modes8085 instruction set and addressing modes
8085 instruction set and addressing modesVijay Kumar
 
8085 microprocessor Architecture and pin description
8085 microprocessor Architecture and pin description 8085 microprocessor Architecture and pin description
8085 microprocessor Architecture and pin description Vijay Kumar
 
8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description 8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description Vijay Kumar
 
8086 Microprocessor Instruction set
8086 Microprocessor Instruction set8086 Microprocessor Instruction set
8086 Microprocessor Instruction setVijay Kumar
 
Input output devices
Input output devicesInput output devices
Input output devicesVijay Kumar
 
Microprocessors evolution introduction to microprocessor
Microprocessors  evolution introduction to microprocessorMicroprocessors  evolution introduction to microprocessor
Microprocessors evolution introduction to microprocessorVijay Kumar
 
Evolution of INTEL Microprocessor
Evolution of INTEL MicroprocessorEvolution of INTEL Microprocessor
Evolution of INTEL MicroprocessorVijay Kumar
 
Origin of Microprocessor and Classification of Microprocessor
Origin of Microprocessor and  Classification of Microprocessor Origin of Microprocessor and  Classification of Microprocessor
Origin of Microprocessor and Classification of Microprocessor Vijay Kumar
 
8085 addressing modes
8085 addressing modes8085 addressing modes
8085 addressing modesVijay Kumar
 
Embedded System Real Time Operating System (ERTS) I unit by vijay
Embedded System Real Time Operating System (ERTS) I unit by vijayEmbedded System Real Time Operating System (ERTS) I unit by vijay
Embedded System Real Time Operating System (ERTS) I unit by vijayVijay Kumar
 
Microcontroller (8051) by K. Vijay Kumar
Microcontroller (8051) by K. Vijay KumarMicrocontroller (8051) by K. Vijay Kumar
Microcontroller (8051) by K. Vijay KumarVijay Kumar
 
8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay KumarVijay Kumar
 
Rs 232 & usb ieee1394 communication
Rs 232 & usb  ieee1394 communicationRs 232 & usb  ieee1394 communication
Rs 232 & usb ieee1394 communicationVijay Kumar
 
Embedded real time-systems communication
Embedded real time-systems communicationEmbedded real time-systems communication
Embedded real time-systems communicationVijay Kumar
 

Plus de Vijay Kumar (20)

Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 Microprocessor
8086 Microprocessor 8086 Microprocessor
8086 Microprocessor
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
8085 instruction set and addressing modes
8085 instruction set and addressing modes8085 instruction set and addressing modes
8085 instruction set and addressing modes
 
8085 microprocessor Architecture and pin description
8085 microprocessor Architecture and pin description 8085 microprocessor Architecture and pin description
8085 microprocessor Architecture and pin description
 
8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description 8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description
 
8086 Microprocessor Instruction set
8086 Microprocessor Instruction set8086 Microprocessor Instruction set
8086 Microprocessor Instruction set
 
Input output devices
Input output devicesInput output devices
Input output devices
 
Microprocessors evolution introduction to microprocessor
Microprocessors  evolution introduction to microprocessorMicroprocessors  evolution introduction to microprocessor
Microprocessors evolution introduction to microprocessor
 
Memory types
Memory typesMemory types
Memory types
 
Memory
MemoryMemory
Memory
 
Evolution of INTEL Microprocessor
Evolution of INTEL MicroprocessorEvolution of INTEL Microprocessor
Evolution of INTEL Microprocessor
 
Origin of Microprocessor and Classification of Microprocessor
Origin of Microprocessor and  Classification of Microprocessor Origin of Microprocessor and  Classification of Microprocessor
Origin of Microprocessor and Classification of Microprocessor
 
8085 addressing modes
8085 addressing modes8085 addressing modes
8085 addressing modes
 
Embedded System Real Time Operating System (ERTS) I unit by vijay
Embedded System Real Time Operating System (ERTS) I unit by vijayEmbedded System Real Time Operating System (ERTS) I unit by vijay
Embedded System Real Time Operating System (ERTS) I unit by vijay
 
Microcontroller (8051) by K. Vijay Kumar
Microcontroller (8051) by K. Vijay KumarMicrocontroller (8051) by K. Vijay Kumar
Microcontroller (8051) by K. Vijay Kumar
 
8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar
 
Rs 232 & usb ieee1394 communication
Rs 232 & usb  ieee1394 communicationRs 232 & usb  ieee1394 communication
Rs 232 & usb ieee1394 communication
 
Embedded real time-systems communication
Embedded real time-systems communicationEmbedded real time-systems communication
Embedded real time-systems communication
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

Understanding interrupts and their uses in 8086 microprocessor

  • 1. By Vijay Kumar. K Asst. Professor Dept. of ECE
  • 2.  When your phone rings during a lecture, what will happen?  When you are studying then your cell phone rings – what will you do? When you finish talking on the phone then you will continue with your study  Now your phone rings again and someone also knocking at your door then what will you do? When being interrupted, you will perform some pre-defined action Interrupt has priority – some interrupt is more important than the others. For example, asking your phone is more important than opening the door
  • 3. Introduction  An interrupt is used to cause a temporary halt in the execution of program.  The meaning of ‘interrupts’ is to break the sequence of operation.  While the Microprocessor is executing a program, an ‘interrupt’ breaks the normal sequence of execution of instructions, diverts its execution to some other program called Interrupt Service Routine (ISR). After executing ISR, IRET returns the control back again to the main program. Interrupt processing is an alternative to polling.
  • 4. Need for Interrupt: Interrupts are particularly useful when interfacing I/O devices, that provide or require data at relatively low data transfer rate. Three types of interrupts sources are there: 1. An external signal applied to NMI or INTR input pin( hardware interrupt) 2. Execution of Interrupt instruction( software interrupt) 3. Interrupt raised due to some error condition produced in 8086 instruction execution process. ( divide by zero, overflow errors etc) Sources of Interrupts:
  • 5. Use of interrupt How to get key typed in the keyboard or a keypad?  Polling :- The CPU executes a program that check for the available of data If a key is pressed then read the data, otherwise keep waiting or looping!!!  Interrupt:- The CPU executes other program, as soon as a key is pressed, the Keyboard generates an interrupt. The CPU will response to the interrupt – read the data. After that returns to the original program. So by proper use of interrupt, the CPU can serve many devices at the “same time”
  • 6. Polling Vs Interrupt The keyboard controller can hold only a single keystroke. Therefore, the keyboard controller must be freed before the next keystroke arrives. The keystroke is passed to the CPU by putting it in the keyboard buffer. So, the keyboard controller keeps on passing the keystroke input to the CPU, but how does the CPU attend to it? The CPU is not at the disposal of the keyboard controller; it is usually busy doing several other operations. So, we need some mechanism to indicate to the CPU that a keystroke has arrived. How is this done? There are two approaches to making sure that the CPU pays attention: Polling-based Interrupt-based
  • 7. Example: Polling Vs Interrupt Keystroke causes interrupt
  • 8. Figure 2: Polling-based interrupt handling Polling  The CPU executes a program that check for the available of data If a key is pressed then read the data, otherwise keep waiting or looping!!!
  • 9. Keystroke passed to the CPU No keystroke for CPU
  • 10. Interrupt-based approach Interrupt-based systems  The CPU executes other program, as soon as a key is pressed, the Keyboard generates an interrupt. The CPU will response to the interrupt – read the data. After that returns to the original program. So by proper use of interrupt, the CPU can serve many devices at the “same time”
  • 11. Example of interrupt  How to control a robot that has sensors to detect obstacles and makes a turn Controlling a robot by using Polling & Interrupt
  • 12.  Interrupt  Keeping moving until interrupted by the sensor  Interrupt received then do pre-defined operation  After finishing the interrupt service return to normal operation i.e keep moving forward again  Polling  Move forward in a pre-defined unit  Check sensor reading  Do nothing if no obstacle or turn if obstacle detected  Loop back and move forward again
  • 13. Polling Vs Interrupt Control of a robot Move forward Check sensor Y Stop or turn Move forward interrupt N
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 56.
  • 57. 8086 INTERRUPT TYPES 256 INTERRUPTS OF 8086 ARE DIVIDED IN TO 3 GROUPS 1. TYPE 0 TO TYPE 4 INTERRUPTS- These Are Used For Fixed Operations And Hence Are Called Dedicated Interrupts 2. TYPE 5 TO TYPE 31 INTERRUPTS Not Used By 8086,reserved For Higher Processors Like 80286 80386 Etc 3. TYPE 32 TO 255 INTERRUPTS Available For User, called User Defined Interrupts These Can Be H/W Interrupts And Activated Through Intr Line Or Can Be S/W Interrupts.
  • 58. Type – 0 Divide Error Interrupt Quotient Is Large Cant Be Fit In Al/Ax Or Divide By Zero Type –1 Single Step Interrupt Used For Executing The Program In Single Step Mode By Setting Trap Flag To Set Trap Flag PUSHF MOV BP,SP OR [BP+0],0100H;SET BIT8 POPF Type – 2 Non Maskable Interrupt This Interrupt Is Used For Executing Isr Of Nmi Pin (Positive Egde Signal). Nmi Cant Be Masked By S/W Type – 3 Break Point Interrupt Used For Providing Break Points In The Program Type – 4 Over Flow Interrupt Used To Handle Any Overflow Error After Signed Arithmetic
  • 59. PRIORITY OF INTERRUPTS Interrupt Type Priority INT0, INT3-INT 255, Highest NMI(INT2) INTR SINGLE STEP Lowest
  • 60.
  • 61. INT 21h is provided by DOS. When MS-DOS is loaded into the computer, INT 21H can be invoked to perform some extremely useful functions. These functions are commonly referred to as DOS INT 21H function calls. Data input and output through the keyboard and monitor are the most commonly used functions. Below are two examples that use DOS interrupts. 1. Display the message defined with variable DATA_ASC DB ‘the earth is but one country’,’$’ MOV AH,09 ;option 9 to display string of data MOV DX, OFFSET DATA_ASC ;DX= offset address of data INT 21H ; invoke the interrupt 2. Inputting a single character, with echo. MOV AH, 01 ;option 01 to input one character INT 21H ;invoke the interrupt DOS interrupts
  • 62. DOS (Disk Operating System) Interrupts 1. Function Call 01: Read The Key Board Input Parameter Ah = 01 Read A Character From Keyboard. Echo It On CRO Screen and Return The ASCII Code Of The Key Pressed in Al Output Parameter: Al = ASCII Code Of Character 2. Function Call 02h: Display On CRT Screen Input Parameter: Ah = 02 Dl = ASCII Character To Be Displayed On CRT Screen 3. Function Call 03: Read Character From Com1 Input Parameter: Ah = 03h Function: Reads Data From Com Port Output Parameter: Al = ASCII Code Of Character 4. Function Call 04: Write Character To Com1 Input Parameter: Ah = 04h Dl = ASCII Code Of Character To Be Transmitted Function: Writes Data To Com Port
  • 63. DOS INTERRUPTS 5. Function Call 05: Write To Lpt1 Input Parameter: Al = 05H Dl = Ascii Code Of Character To Be Printted Function: Print The Character Available In Dl On Printer Attached To Lpt1 6. Function Call 09: Display A Character String Input Parameter: Ah = 09,ds:dx= Address Of Character String Function: Displays The Characters Available In The String To Crt Till A $ 7. Function Call 0ah: Buffered Key Board Input Input Parameter: Ah = 0ah Ds:dx = Address Of Keyboard Input Buffer Function: The ASCII Codes Of The Characters Received From Keyboard Are Stored In Keyboard Buffer From 3rd Byte. 1st Byte Of Buffer = Size Of Buffer Upto 255. It Receives The Characters Till Specified No.Of Characters Are Received Or Enter Key Is Presses Which Ever Is Earlier
  • 64. INT 10H subroutines are burned into the ROM BIOS of the 8086 based and compatibles and are used to communicate with the computer user screen video. Much of the manipulation of screen text or graphics is done through INT 10H. Among them are changing the color of characters or background, clearing screen, and changing the locations of cursor. Below are two examples that use BIOS interrupts. 1. Clearing the screen: MOV AX, 0600H ;scroll entire screen MOV BH, 07 ;normal attribute MOV CX, 0000 ;start at 00,00 MOV DX, 184FH ;end at 18, 4F INT 10H ;invoke the interrupt BIOS interrupt
  • 65. BIOS (Basic Input/output System) INTERRUPTS INT 10h:Video Service Interrupt It Controls The Video Display (a) Function Call 00: Select Video Mode Input Parameter: Al = Mode Number Ah = 00h Function: It Changes The Display Mode And Clears The Screen Al = 00 40 X 25 Black And White Al = 04 320 X 200 Color Al = 10h 640 X 350 X 16 Color (b) FUNCTION CALL 03: READ CURSOR POSITION Input Parameter: Ah = 03 Bh = Page Number Function: Reads Cursor Position On Screen Output Parameters: Ch = Starting Line Cl = Ending Line Dh = Current Row Dl = Current Column
  • 66. BIOS INTERRUPTS ( C) Function Call 0E:Write Character On CRT Screen And Advance Cursor Input Parameter:Ah = 0eh Al = ASCII Code Of The Character Bh = Page(text Mode) Bl = Color(graphics) Function: Display Character Available In Al On Screen INT 11h: Determine The Type Of Equipment Installed. Register Ax Should Contain FFFFh And Instruction INT 11h To Be Executed. On Return, Register Ax Will Indicate The Equipments Attached To Computer INT14h: Control The Serial Communication Port Attached To The Computer. Ah Should Contain The Function Call (a) Function Call 00:initialize The Com Port (b) Function Call 01: Send A Character (c) Function Call 02:receive A Character INT 16h: Keyboard Interrupt Ah Should Contain The Function Call (a) Function Call 00: Read Keyboard Character, It Will Return Ascii Code Of The Character (b) Function Call 01: Get Key Board Status