home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / misc / vfwdk / samples / bravado / isr.asm < prev    next >
Assembly Source File  |  1993-01-31  |  3KB  |  118 lines

  1.         TITLE ISR.ASM
  2.         page 60,132
  3.  
  4. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5. ;
  6. ; ISR.ASM - Interrupt service routine entry point
  7. ;
  8. ; (C) Copyright Microsoft Corp. 1992-1993.  All rights reserved.
  9. ;
  10. ; You have a royalty-free right to use, modify, reproduce and 
  11. ; distribute the Sample Files (and/or any modified version) in 
  12. ; any way you find useful, provided that you agree that 
  13. ; Microsoft has no warranty obligations or liability for any 
  14. ; Sample Application Files which are modified. 
  15. ;
  16. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  17.  
  18. ?PLM=1        ; PASCAL Calling convention is DEFAULT
  19. ?WIN=0      ; Windows calling convention
  20.  
  21.     .286
  22.         .xlist
  23.         include cmacros.inc
  24.         include vcap.inc
  25.         .list
  26.  
  27.         externNP        InStreamISR                             ; cap.c
  28.     externFP     CT_IRQClear
  29.  
  30. ; -------------------------------------------------------
  31. ;               DATA SEGMENT DECLARATIONS
  32. ; -------------------------------------------------------
  33.  
  34. ifndef SEGNAME
  35.         SEGNAME equ <_TEXT>
  36. endif
  37.  
  38. createSeg %SEGNAME, CodeSeg, word, public, CODE
  39.  
  40.         externD         _dwVideoClock
  41.         externB         gbInt,             -1
  42.         externW         gwBaseReg,         -1
  43.  
  44. sBegin Data
  45.     wIntCount    dw    0000h
  46. sEnd Data
  47.  
  48. sBegin CodeSeg
  49.         assumes cs,CodeSeg
  50.         assumes ds,Data
  51.         assumes es,nothing
  52.  
  53.  
  54. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  55. ; CT_ISR     Interrupt handler entry point
  56. ;
  57. ; Ideas from the SndBlst driver
  58. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  59.     assumes ds,nothing
  60.     assumes es,nothing
  61.  
  62.     public CT_ISR
  63. .386
  64. CT_ISR proc far
  65.  
  66.     cld            ; never assume this at interrupt time!
  67.  
  68.     .386
  69.     pushad
  70.     push    ds
  71.     push    es
  72.     push    fs
  73. ;    push    gs
  74.  
  75.         ; set up local DS
  76.  
  77.         mov     ax, DataBASE
  78.         mov     ds, ax
  79.     assumes ds,Data
  80.  
  81.     add    _dwVideoClock.lo,1
  82.     adc    _dwVideoClock.hi,0
  83.  
  84.     ; Set it up so other interrupts can come through.
  85.         ; send EOI to PIC
  86.         mov     al, 20H                ; non-specific EOI
  87.  
  88.         cmp     [gbInt], 8
  89.         jb      @f
  90.         out     0A0h, al               ; slave EOI
  91. @@:     out     020h, al               ; master EOI
  92.  
  93.         cCall   CT_IRQClear            ; re-enable device interrupts
  94.         
  95.     cmp    [wIntCount],0
  96.     jnz    isrExit
  97.  
  98.     ; Check the timing and perform the frame capture if needed
  99.     inc    [wIntCount]
  100.     sti
  101.     cCall    InStreamISR
  102.     dec    [wIntCount]
  103.  
  104. isrExit:
  105. ;    pop    gs
  106.     pop    fs
  107.     pop    es
  108.     pop    ds
  109.     assumes ds,nothing
  110.     popad
  111.     .286
  112.         iret
  113.  
  114. CT_ISR endp
  115.  
  116. sEnd
  117. end
  118.