User`s manual
UPS25 38 RTD Embedded Technologies, Inc
Before you install your ISR, temporarily mask out the IRQ you will be using. This
prevents the IRQ from requesting an interrupt while you are installing and
initializing your ISR. To mask the IRQ, read the current IMR at I/O port 21h, and
set the bit that corresponds to the IRQ. The IMR is arranged so that bit 0 is for
IRQ0 and bit 7 is for IRQ7. See the paragraph entitled Interrupt Mask Register
(IMR) earlier in this discussion for help in determining your IRQs bit. After setting
the bit, write the new value to I/O port 21h.
With the startup IMR saved and the interrupts temporarily disabled, you can assign
the interrupt vector to point to your ISR. Again you can overwrite the appropriate
entry in the vector table with a direct memory write, but this is not recommended.
Instead use the DOS function 25h (Set Interrupt Vector) or, if your compiler
provides it, the library routine for setting up interrupt vectors. Remember that
interrupt vector 8 corresponds to IRQ0, vector 9 for IRQ1 etc.
If you need to program the source of your interrupts, do that next. For example, if
you are using transmitted or received messages as an interrupt source program it
to do that. Finally, clear the mask bit for your IRQ in the IMR. This will enable your
IRQ.
Common Interrupt mistakes
Remember hardware interrupts are from 8-15, XT IRQs are numbered 0-7. Do not
forget to clear the IRQ mask bit in the IMR Forgetting to send the EOI command
after ISR code. Disables further interrupts.










