SlideShare a Scribd company logo
1 of 20
1
CONTENTS
 Interrupt
 Interrupts in 8086
 CPU’s ‘Fetch-Execute’ cycle
 The operation of an interrupt sequence on 8086
 Mouse features
      Pixel
      Mouse pointer
      Mickey
 Interrupt Vector Table(IVT)
 IVT Format
 Mouse functions

                                                   2
INTERRUPT
 In computing an interrupt is an asynchronous signal indicating the
  need for attention.

 Interrupts are a commonly used technique for computer multitasking,
  Such a system is said to be interrupt driven.

 An act of interrupting is referred to as an interrupt request (IRQ).

 The part of a program that deals with the interrupt is referred to as an
  service routine (ISR) or interrupt handler.




                                                                             3
Interrupts in 8086
An 8086 Interrupt can come from any of three sources.

Hardware Interrupt

• External interrupt applied to non-maskable interrupt NMI.
        Interrupt response cannot be disabled ( masked) by
        any program instruction.

• External interrupt applied to maskable interrupt INTR.

Software Interrupt

• Execution of INT instruction.




                                                              4
CPU’s ‘Fetch-Execute’ Cycle
           Fetch instruction at IP


       Decode the fetched instruction          Save context

                                               Get INTR ID
       Execute the decoded instruction
                                               Lookup ISR
       Advance IP to next instruction
                                               Execute ISR


                 Interrupt?              yes        IRET

                  no
                                                              5
The Operation of an Interrupt sequence on
the 8086 Microprocessor:
1. External interface sends an interrupt signal, to the Interrupt Request
   (INTR) pin, or an internal interrupt occurs.

2. The CPU finishes the present instruction (for a hardware interrupt) and

  sends Interrupt Acknowledge (INTA) to hardware interface.

3. The interrupt type N is sent to the Central Processor Unit (CPU) via the

   Data bus from the hardware interface.

4. The contents of the flag registers are pushed onto the stack.

5. Both the interrupt (IF) and (TF) flags are cleared. This disables the INTR
  pin and the trap or single-step feature.


                                                                              6
Interrupt sequence contd…
6. The contents of the code segment register (CS) are pushed onto the

    Stack.

7. The contents of the instruction pointer (IP) are pushed onto the Stack.

8. The interrupt vector contents are fetched, from (4 x N) and then placed

   into the IP and from (4 x N +2) into the CS so that the next instruction

   executes at the interrupt service procedure addressed by the interrupt

   vector.

9. While returning from the interrupt-service routine by the Interrupt
  Return(IRET) instruction, the IP, CS and Flag registers are popped from
  the Stack and return to their state prior to the interrupt.

                                                                             7
Interfacing with mouse
 Second primary input devices used is the mouse.

 It has a greater flexibility and movement.

 Mouse system consist of the mouse and the mouse driver.

 Mouse driver is the memory resident program that provides
  communication between the mouse and the computer.

 Mouse driver maintains the cursor position of the mouse and the status
  of the mouse buttons.




                                                                           8
Mouse Features
Pixel:
 A pixel or pel (picture element) is a single point in a raster image, or
  the smallest addressable screen element in a display device.

 It is the smallest unit of picture that can be represented or controlled.

 Each pixel has its own address.

 The address of a pixel corresponds to its coordinates.

 Pixels are normally arranged in a two-dimensional grid and are often
  represented using dots or squares.

 Each pixel is a sample of an original image. More samples typically
  provide more accurate representations of the original image.

                                                                              9
Mouse Features
Mouse pointer:
 A mouse pointer, or a cursor, is a visible indicator displayed on a
  computer screen.

 By moving the mouse, the computer's user can move the mouse
  pointer around the screen.

 The mouse pointer located on the screen can determine how and
  where the user can press a button on the mouse to input text or execute
  a command.




                                                                            10
Mouse Features
Mickey:

 A unit of measure for movement of the mouse, approximately 1/200 of an
  inch.

 A mickey is a unit of measurement for the speed and

  movement direction of a computer mouse.

 The speed of the mouse is the ratio between how many pixels the cursor
  moves on the screen and how many centimeters you move the mouse on
  the mouse pad.



                                                                           11
Interrupt Vector Table – IVT (in memory)

 x86 has 256 interrupts, specified by Type Number or Vector.

 1 byte of data must accompany each interrupt(specifies Type).

 Vector is a pointer (address) into Interrupt Vector Table (IVT).

     - IVT is stored in memory from 0000:0000 to 0000:03ffh

     - IVT contains 256 far pointer values (addresses)

     - Far pointer is CS:IP values

 Each far pointer is address of Interrupt Service Routine (ISR).

     - Also referred to as Interrupt Handler.


                                                                     12
IVT Format
0000:0000
0000:0001
             Offset
0000:0002
                        Interrupt 0                    IP LSB

0000:0003
            Segment                                    IP MSB

0000:0004                                              CS LSB

0000:0005
             Offset                                    CS MSB
                        Interrupt 1
0000:0006
0000:0007
            Segment


                                        Given a Vector, where is the
                                        ISR address stored in memory ?


                                              Offset     Type 4
0000:03fc
0000:03fd
             Offset                       Example:int 36h
0000:03fe
                        Interrupt 255
            Segment                       Offset = (54 4) = 216
0000:03ff
                                                = 00d8h
Mouse functions
 We can access the cursor position and the button status with interrupt
  33h.

 The mouse driver has several functions by specifying the function
  number in the AX register when calling interrupt 33h.

 Some of the functions are

         0- Resets the mouse and retrieves the mouse status.

         1- Displays the mouse cursor

         2- Hides the mouse cursor.

         3- Retrieves the mouse cursor positioned the status of
  the mouse buttons.

                                                                           14
Mouse functions contd…
Initializing the mouse:

 To be able to use the mouse it must be first tested whether it is present
  or not.

         int 33h
         mov ax,00
         int 33h
         mov result,ax


 Using int 33h is the necessary first step toward using the mouse.

 If this service returns a non-zero value, the mouse is initialized.

  Otherwise, the mouse cannot be used.


                                                                              15
Mouse functions contd…
Display mouse cursor:


 Initializing the mouse does not display the mouse cursor.
 A function that initialize the mouse and returns the result.

 Int 33h service 1 – display mouse cursor.



         mov ax,01h

         int 33h



   At this point ,the mouse system is active and the cursor has appeared
    on the screen.
                                                                        16
Mouse functions contd…

Hide mouse cursor:


 If the cursor is already off, it stays off (int 33h service 2).

 The very important reason for hiding the mouse cursor , as the mouse
  cursor moves over the screen,the mouse driver software reads the
  character at the preset position before it displays the mouse cursor.


         mov ax,02h
         int 33h




                                                                          17
Mouse functions contd…
Mouse buttons:
 It is also possible to read right and left button information from the mouse int
  33h service 3.

Getting mouse information:
 Int 33h service 3 set AX=3 .This will return

        BX            meaning
         0     No button down
          1        Left button down
         2      Right button down
         3      Both the buttons down
 CX = current mouse cursor column.

 DX= current mouse cursor row.

                                                                                     18
Mouse functions contd…
         Mov ax, 03h
         Int 33h
         Mov button, bx
         Mov row, dx
         Mov col, cx


 This service 3, returns information in bx, dx, and cx.

 bx indicates which button(s) are down.

 This service also returns the current row and column of the mouse
  cursor in dx and cx, respectively.




                                                                      19
THANK YOU




            20

More Related Content

What's hot

Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessorhepzijustin
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control UnitKamal Acharya
 
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101Premier Farnell
 
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...vem2001
 
Microcontroller pic 16f877 addressing modes instructions and programming
Microcontroller pic 16f877 addressing modes instructions and programmingMicrocontroller pic 16f877 addressing modes instructions and programming
Microcontroller pic 16f877 addressing modes instructions and programmingNilesh Bhaskarrao Bahadure
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
Pulse amplitude modulation & demodulation
Pulse amplitude modulation & demodulationPulse amplitude modulation & demodulation
Pulse amplitude modulation & demodulationVishal kakade
 
Device drivers and interrupt service mechanism
Device drivers and interrupt service mechanismDevice drivers and interrupt service mechanism
Device drivers and interrupt service mechanismVijay Kumar
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisAmr E. Mohamed
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 

What's hot (20)

Matched filter
Matched filterMatched filter
Matched filter
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
 
Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessor
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control Unit
 
6lowpan
6lowpan6lowpan
6lowpan
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
 
Addressing sequencing
Addressing sequencingAddressing sequencing
Addressing sequencing
 
Unit I.fundamental of Programmable DSP
Unit I.fundamental of Programmable DSPUnit I.fundamental of Programmable DSP
Unit I.fundamental of Programmable DSP
 
Interrupt 8085
Interrupt 8085Interrupt 8085
Interrupt 8085
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
 
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
 
Microcontroller pic 16f877 addressing modes instructions and programming
Microcontroller pic 16f877 addressing modes instructions and programmingMicrocontroller pic 16f877 addressing modes instructions and programming
Microcontroller pic 16f877 addressing modes instructions and programming
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Pulse amplitude modulation & demodulation
Pulse amplitude modulation & demodulationPulse amplitude modulation & demodulation
Pulse amplitude modulation & demodulation
 
Device drivers and interrupt service mechanism
Device drivers and interrupt service mechanismDevice drivers and interrupt service mechanism
Device drivers and interrupt service mechanism
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 

Viewers also liked (20)

Interrupt
InterruptInterrupt
Interrupt
 
Interrupts
InterruptsInterrupts
Interrupts
 
37471656 interrupts
37471656 interrupts37471656 interrupts
37471656 interrupts
 
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
 
Interrupts
InterruptsInterrupts
Interrupts
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
 
Computer system
Computer systemComputer system
Computer system
 
Instruction, interrupts & io processing
Instruction, interrupts & io processingInstruction, interrupts & io processing
Instruction, interrupts & io processing
 
Ndfa
NdfaNdfa
Ndfa
 
Presentation on
Presentation onPresentation on
Presentation on
 
Interrupts
InterruptsInterrupts
Interrupts
 
Fit unit 2 interrupts
Fit unit 2 interruptsFit unit 2 interrupts
Fit unit 2 interrupts
 
13 superscalar
13 superscalar13 superscalar
13 superscalar
 
63071507 interrupts-up
63071507 interrupts-up63071507 interrupts-up
63071507 interrupts-up
 
Handling Interrupts in Microchip MCUs
Handling Interrupts in Microchip MCUsHandling Interrupts in Microchip MCUs
Handling Interrupts in Microchip MCUs
 
INTEL’S MMX TECHNOLOGY FOR ENHANCED PROCESSOR
INTEL’S MMX TECHNOLOGY FOR ENHANCED PROCESSORINTEL’S MMX TECHNOLOGY FOR ENHANCED PROCESSOR
INTEL’S MMX TECHNOLOGY FOR ENHANCED PROCESSOR
 
Intel processors
Intel processorsIntel processors
Intel processors
 
System quality attributes
System quality attributes System quality attributes
System quality attributes
 
Superscalar processors
Superscalar processorsSuperscalar processors
Superscalar processors
 
8051 Inturrpt
8051 Inturrpt8051 Inturrpt
8051 Inturrpt
 

Similar to Mouse interrupts (Assembly Language & C)

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
 
Gesture Controlled Car_Project report
Gesture Controlled Car_Project reportGesture Controlled Car_Project report
Gesture Controlled Car_Project reportAshikapokiya12345
 
How Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protectionsHow Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protectionsJonathan Salwan
 
Interrupt in ATMEGA328P.pptx
Interrupt in ATMEGA328P.pptxInterrupt in ATMEGA328P.pptx
Interrupt in ATMEGA328P.pptxSujalKumar73
 
Interrupts of 8085
Interrupts of 8085Interrupts of 8085
Interrupts of 8085ShivamSood22
 
Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Vikas Dongre
 
Advanced Microprocessors
Advanced MicroprocessorsAdvanced Microprocessors
Advanced MicroprocessorsBuddiesSairamit
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijayVijay Kumar
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandotascmandota
 
U proc ovw
U proc ovwU proc ovw
U proc ovwBrit4
 
Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017Cristofaro Mune
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Future Insights
 

Similar to Mouse interrupts (Assembly Language & C) (20)

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
 
Gesture Controlled Car_Project report
Gesture Controlled Car_Project reportGesture Controlled Car_Project report
Gesture Controlled Car_Project report
 
How Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protectionsHow Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protections
 
Space mouse
Space mouseSpace mouse
Space mouse
 
Interrupt in ATMEGA328P.pptx
Interrupt in ATMEGA328P.pptxInterrupt in ATMEGA328P.pptx
Interrupt in ATMEGA328P.pptx
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
lesson24.ppt
lesson24.pptlesson24.ppt
lesson24.ppt
 
Linux interrupts
Linux interruptsLinux interrupts
Linux interrupts
 
Interrupts of 8085
Interrupts of 8085Interrupts of 8085
Interrupts of 8085
 
Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051
 
Advanced Microprocessors
Advanced MicroprocessorsAdvanced Microprocessors
Advanced Microprocessors
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
 
Coa INTERUPT
Coa INTERUPTCoa INTERUPT
Coa INTERUPT
 
Interrupts
InterruptsInterrupts
Interrupts
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
U proc ovw
U proc ovwU proc ovw
U proc ovw
 
Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)
 
Introduction
Introduction Introduction
Introduction
 

More from Tech_MX

Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Stack data structure
Stack data structureStack data structure
Stack data structureTech_MX
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2Tech_MX
 
Set data structure
Set data structure Set data structure
Set data structure Tech_MX
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pcTech_MX
 
More on Lex
More on LexMore on Lex
More on LexTech_MX
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbmsTech_MX
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 

More from Tech_MX (20)

Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Uid
UidUid
Uid
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
String & its application
String & its applicationString & its application
String & its application
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Stack data structure
Stack data structureStack data structure
Stack data structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Spss
SpssSpss
Spss
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Set data structure
Set data structure Set data structure
Set data structure
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Parsing
ParsingParsing
Parsing
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pc
 
More on Lex
More on LexMore on Lex
More on Lex
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbms
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 
Linkers
LinkersLinkers
Linkers
 

Recently uploaded

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Mouse interrupts (Assembly Language & C)

  • 1. 1
  • 2. CONTENTS  Interrupt  Interrupts in 8086  CPU’s ‘Fetch-Execute’ cycle  The operation of an interrupt sequence on 8086  Mouse features  Pixel  Mouse pointer  Mickey  Interrupt Vector Table(IVT)  IVT Format  Mouse functions 2
  • 3. INTERRUPT  In computing an interrupt is an asynchronous signal indicating the need for attention.  Interrupts are a commonly used technique for computer multitasking, Such a system is said to be interrupt driven.  An act of interrupting is referred to as an interrupt request (IRQ).  The part of a program that deals with the interrupt is referred to as an service routine (ISR) or interrupt handler. 3
  • 4. Interrupts in 8086 An 8086 Interrupt can come from any of three sources. Hardware Interrupt • External interrupt applied to non-maskable interrupt NMI. Interrupt response cannot be disabled ( masked) by any program instruction. • External interrupt applied to maskable interrupt INTR. Software Interrupt • Execution of INT instruction. 4
  • 5. CPU’s ‘Fetch-Execute’ Cycle Fetch instruction at IP Decode the fetched instruction Save context Get INTR ID Execute the decoded instruction Lookup ISR Advance IP to next instruction Execute ISR Interrupt? yes IRET no 5
  • 6. The Operation of an Interrupt sequence on the 8086 Microprocessor: 1. External interface sends an interrupt signal, to the Interrupt Request (INTR) pin, or an internal interrupt occurs. 2. The CPU finishes the present instruction (for a hardware interrupt) and sends Interrupt Acknowledge (INTA) to hardware interface. 3. The interrupt type N is sent to the Central Processor Unit (CPU) via the Data bus from the hardware interface. 4. The contents of the flag registers are pushed onto the stack. 5. Both the interrupt (IF) and (TF) flags are cleared. This disables the INTR pin and the trap or single-step feature. 6
  • 7. Interrupt sequence contd… 6. The contents of the code segment register (CS) are pushed onto the Stack. 7. The contents of the instruction pointer (IP) are pushed onto the Stack. 8. The interrupt vector contents are fetched, from (4 x N) and then placed into the IP and from (4 x N +2) into the CS so that the next instruction executes at the interrupt service procedure addressed by the interrupt vector. 9. While returning from the interrupt-service routine by the Interrupt Return(IRET) instruction, the IP, CS and Flag registers are popped from the Stack and return to their state prior to the interrupt. 7
  • 8. Interfacing with mouse  Second primary input devices used is the mouse.  It has a greater flexibility and movement.  Mouse system consist of the mouse and the mouse driver.  Mouse driver is the memory resident program that provides communication between the mouse and the computer.  Mouse driver maintains the cursor position of the mouse and the status of the mouse buttons. 8
  • 9. Mouse Features Pixel:  A pixel or pel (picture element) is a single point in a raster image, or the smallest addressable screen element in a display device.  It is the smallest unit of picture that can be represented or controlled.  Each pixel has its own address.  The address of a pixel corresponds to its coordinates.  Pixels are normally arranged in a two-dimensional grid and are often represented using dots or squares.  Each pixel is a sample of an original image. More samples typically provide more accurate representations of the original image. 9
  • 10. Mouse Features Mouse pointer:  A mouse pointer, or a cursor, is a visible indicator displayed on a computer screen.  By moving the mouse, the computer's user can move the mouse pointer around the screen.  The mouse pointer located on the screen can determine how and where the user can press a button on the mouse to input text or execute a command. 10
  • 11. Mouse Features Mickey:  A unit of measure for movement of the mouse, approximately 1/200 of an inch.  A mickey is a unit of measurement for the speed and movement direction of a computer mouse.  The speed of the mouse is the ratio between how many pixels the cursor moves on the screen and how many centimeters you move the mouse on the mouse pad. 11
  • 12. Interrupt Vector Table – IVT (in memory)  x86 has 256 interrupts, specified by Type Number or Vector.  1 byte of data must accompany each interrupt(specifies Type).  Vector is a pointer (address) into Interrupt Vector Table (IVT). - IVT is stored in memory from 0000:0000 to 0000:03ffh - IVT contains 256 far pointer values (addresses) - Far pointer is CS:IP values  Each far pointer is address of Interrupt Service Routine (ISR). - Also referred to as Interrupt Handler. 12
  • 13. IVT Format 0000:0000 0000:0001 Offset 0000:0002 Interrupt 0 IP LSB 0000:0003 Segment IP MSB 0000:0004 CS LSB 0000:0005 Offset CS MSB Interrupt 1 0000:0006 0000:0007 Segment Given a Vector, where is the ISR address stored in memory ? Offset Type 4 0000:03fc 0000:03fd Offset Example:int 36h 0000:03fe Interrupt 255 Segment Offset = (54 4) = 216 0000:03ff = 00d8h
  • 14. Mouse functions  We can access the cursor position and the button status with interrupt 33h.  The mouse driver has several functions by specifying the function number in the AX register when calling interrupt 33h.  Some of the functions are 0- Resets the mouse and retrieves the mouse status. 1- Displays the mouse cursor 2- Hides the mouse cursor. 3- Retrieves the mouse cursor positioned the status of the mouse buttons. 14
  • 15. Mouse functions contd… Initializing the mouse:  To be able to use the mouse it must be first tested whether it is present or not. int 33h mov ax,00 int 33h mov result,ax  Using int 33h is the necessary first step toward using the mouse.  If this service returns a non-zero value, the mouse is initialized. Otherwise, the mouse cannot be used. 15
  • 16. Mouse functions contd… Display mouse cursor:  Initializing the mouse does not display the mouse cursor.  A function that initialize the mouse and returns the result.  Int 33h service 1 – display mouse cursor. mov ax,01h int 33h  At this point ,the mouse system is active and the cursor has appeared on the screen. 16
  • 17. Mouse functions contd… Hide mouse cursor:  If the cursor is already off, it stays off (int 33h service 2).  The very important reason for hiding the mouse cursor , as the mouse cursor moves over the screen,the mouse driver software reads the character at the preset position before it displays the mouse cursor. mov ax,02h int 33h 17
  • 18. Mouse functions contd… Mouse buttons:  It is also possible to read right and left button information from the mouse int 33h service 3. Getting mouse information:  Int 33h service 3 set AX=3 .This will return BX meaning 0 No button down 1 Left button down 2 Right button down 3 Both the buttons down  CX = current mouse cursor column.  DX= current mouse cursor row. 18
  • 19. Mouse functions contd… Mov ax, 03h Int 33h Mov button, bx Mov row, dx Mov col, cx  This service 3, returns information in bx, dx, and cx.  bx indicates which button(s) are down.  This service also returns the current row and column of the mouse cursor in dx and cx, respectively. 19
  • 20. THANK YOU 20