English
Language : 

GPS140 Datasheet, PDF (28/38 Pages) List of Unclassifed Manufacturers – GPS Positioning Module
Interrupt Mask Register (IMR)
Each bit in the interrupt mask register (IMR) contains the mask status of the interrupt
line. If a bit is set (equal to 1), then the corresponding IRQ is masked, and it will not
generate an interrupt. If a bit is cleared (equal to 0), then the corresponding IRQ is not
masked, and it can then generate an interrupt. The interrupt mask register is
programmed through port 21h.
End-of-Interrupt (EOI) Command
After an interrupt service routine is complete, the 8259 Interrupt Controller must be
acknowledged by writing the value 20h to port 20h.
What exactly happens when an interrupt occurs?
Understanding the sequence of events when an interrupt is triggered is necessary to
correctly write interrupt handlers. When an interrupt request line is driven high by a
peripheral device (such as the GPS140HR), the interrupt controller checks to see if
interrupts are enabled for that IRQ. It then checks to see if other interrupts are active or
requested and determines which interrupt has priority. The interrupt controller then
interrupts the processor. The current code segment (CS), instruction pointer (IP), and
flags are pushed onto the system stack., and a new set if CS and IP are loaded from
the lowest 1024 bytes of memory.
This table is referred to as the interrupt vector table and each entry to this table is
called an interrupt vector. Once the new CS and IP are loaded from the interrupt vector
table, the processor starts to execute code from the new Code Segment (CS) and
from the new Instruction Pointer (IP). When the interrupt routine is completed, the old
CS and IP are popped from the system stack and the program execution continues
from the point where interruption occurred.
Using Interrupts in your Program
Adding interrupt support to your program is not as difficult as it may seem especially
when programming under DOS. The following discussion will cover programming
under DOS. Note that even the smallest mistake in your interrupt program may cause
the computer to hang up and will only restart after a reboot. This can be frustrating and
time-consuming.
GPS140HR
28
RTD Embedded Technologies, Inc.