SlideShare a Scribd company logo
1 of 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
8086 Interrupts &  With DOS and BIOS  by vijay

More Related Content

What's hot

Flag registers (assembly language) with types and examples
Flag registers (assembly language) with types and examplesFlag registers (assembly language) with types and examples
Flag registers (assembly language) with types and examplesComputer_ at_home
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085ShivamSood22
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference InstructionsRabin BK
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controllerTech_MX
 
Pipeline processing and space time diagram
Pipeline processing and space time diagramPipeline processing and space time diagram
Pipeline processing and space time diagramRahul Sharma
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
Control Unit Design
Control Unit DesignControl Unit Design
Control Unit DesignVinit Raut
 
Memory Segmentation of 8086
Memory Segmentation of 8086Memory Segmentation of 8086
Memory Segmentation of 8086Nikhil Kumar
 
Logical and shift micro operations
Logical and shift micro operationsLogical and shift micro operations
Logical and shift micro operationsSanjeev Patel
 
Asynchronous data transfer
Asynchronous data transferAsynchronous data transfer
Asynchronous data transferpriya Nithya
 
Computer registers
Computer registersComputer registers
Computer registersDeepikaT13
 

What's hot (20)

Flag registers (assembly language) with types and examples
Flag registers (assembly language) with types and examplesFlag registers (assembly language) with types and examples
Flag registers (assembly language) with types and examples
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Pipeline processing and space time diagram
Pipeline processing and space time diagramPipeline processing and space time diagram
Pipeline processing and space time diagram
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
Addressing sequencing
Addressing sequencingAddressing sequencing
Addressing sequencing
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
8086 alp
8086 alp8086 alp
8086 alp
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
Registers
RegistersRegisters
Registers
 
Control Unit Design
Control Unit DesignControl Unit Design
Control Unit Design
 
Memory Segmentation of 8086
Memory Segmentation of 8086Memory Segmentation of 8086
Memory Segmentation of 8086
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Ch12 microprocessor interrupts
Ch12 microprocessor interruptsCh12 microprocessor interrupts
Ch12 microprocessor interrupts
 
Logical and shift micro operations
Logical and shift micro operationsLogical and shift micro operations
Logical and shift micro operations
 
Asynchronous data transfer
Asynchronous data transferAsynchronous data transfer
Asynchronous data transfer
 
Computer registers
Computer registersComputer registers
Computer registers
 

Similar to 8086 Interrupts & With DOS and BIOS by vijay

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
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORGurudev joshi
 
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
 

Similar to 8086 Interrupts & With DOS and BIOS by vijay (20)

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
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSOR
 
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
 

More from 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
 

More from 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
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

8086 Interrupts & With DOS and BIOS by vijay

  • 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