home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / int70.doc < prev    next >
Text File  |  1989-12-27  |  2KB  |  48 lines

  1. INT 70H (IRQ 8) - ALARM INTERRUPT HANDLER (RTC) hardware interrupt
  2.         This Routine handles the Periodic and Alarm Interrupts from the CMOS
  3.         TIMER. Input Frequency is 1.024 KHZ or approximately 1024 interrupts
  4.         every second for the Periodic Interrupt. For the Alarm Function,
  5.         the interrupt will occur at the designated time.
  6.  
  7.         Interrupts are Enabled when the EVENT or ALARM Function is Activated.
  8.         For the EVENT INTERRUPT, the Handler will decrease the WAIT COUNTER
  9.         and when it expires will SET the designated Location to 80H. For the
  10.         ALARM INTERRUPT, the user must provide a routine to intercept the 
  11.         correct address from the VECTOR TABLE invoked by INTERRUPT 4AH
  12.         prior to SETTING the REAL TIMER CLOCK ALARM (INT 1AH, AH = 06H)
  13.  
  14. PDL:
  15.         Save the registers
  16.         RESTART:
  17.         Read the PIE and AIE bits from the index 0Bh of COMS (bit 5,4)
  18.         IF PIE and AIE is not Enabled (= 0,0)
  19.         THEN
  20.             jump EXIT:
  21.         ELSE
  22.             Read the PF and AF bits from the index 0Ch of CMOS (bit 5,4)
  23.             IF PIE is Enabled (=1) and Periodic Interrupt is occured (PF=1)
  24.             THEN 
  25.                 Decrease the User Wait Count (0,976) (High, Low - 40:9E,40:9C)
  26.                 IF User Wait Count < 0 
  27.                 THEN
  28.                     Turn Off Periodic Interrupt Enable
  29.                     Set the Wait Active Flag Off (40:A0 = 0)
  30.                     Set User Wait Complete Flag ON (= 80H)
  31.                     (Offset Address to User Wait Complete Flag - 40:98,
  32.                     Segment Address to User Wait Complete Flag - 40:9A)
  33.                 ENDIF
  34.             ENDIF     
  35.             IF AIE is Enabled (=1) and Alarm Interrupt is occured (AF=1)
  36.             THEN
  37.             Enable NMI from the CMOS
  38.             Call the User interrupt routine (INT 4AH)
  39.             jump RESTART:
  40.             ENDIF
  41.         ENDIF     
  42.  
  43.         EXIT:
  44.         Enable NMI from the CMOS
  45.         Send EOI to 8259 Interrupt Controller
  46.         restore the registers
  47.         return
  48.