home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / PKVEC.ASM < prev    next >
Assembly Source File  |  1991-03-27  |  2KB  |  93 lines

  1. ; Packet driver interrupt hooks
  2.  
  3.     .MODEL    MEMMOD,C
  4.     %MACS
  5.     extrn    pkint:proc
  6.  
  7.     .DATA
  8.     extrn    Stktop
  9.  
  10.     .CODE
  11. sssave    dw    ?
  12. spsave    dw    ?
  13. axsave    dw    ?
  14. dbase    dw    @Data
  15.  
  16. ; pkvec0 - Packet driver receive call handler #0
  17.     public    pkvec0
  18.     label    pkvec0    far
  19.     pushf            ; save his interrupt state
  20.     cli            ; no distractions
  21.     mov    cs:sssave,ss    ; stash user stack context
  22.     mov    cs:spsave,sp
  23.     mov    cs:axsave,ax    ; save our AX register
  24.  
  25.     mov    ss,cs:dbase    ; set up interrupt stack
  26.     lea    sp,Stktop
  27.     push    ds        ; save for caller
  28.  
  29.     mov    ax,ss
  30.     mov    ds,ax
  31.     mov    ax,0    ; device #0
  32.     push    ax
  33.     mov    ax,cs:axsave    ; Restore AX
  34.     pushf        ; make it look like an INTERRUPT
  35.     call    pkint
  36.     jmp    pkret
  37.  
  38. ; pkvec1 - Packet driver receive call handler #1
  39.     public    pkvec1
  40.     label    pkvec1    far
  41.     pushf            ; save his interrupt state
  42.     cli            ; no distractions
  43.     mov    cs:sssave,ss    ; stash user stack context
  44.     mov    cs:spsave,sp
  45.     mov    cs:axsave,ax    ; save our AX register
  46.  
  47.     mov    ss,cs:dbase    ; set up interrupt stack
  48.     lea    sp,Stktop
  49.     push    ds        ; save for caller
  50.  
  51.     mov    ax,ss
  52.     mov    ds,ax
  53.     mov    ax,1    ; device #1
  54.     push    ax
  55.     mov    ax,cs:axsave    ; Restore AX
  56.     pushf        ; make it look like an INTERRUPT
  57.     call    pkint
  58.     jmp    pkret
  59.  
  60. ; pkvec2 - Packet driver receive call handler #2
  61.     public    pkvec2
  62.     label    pkvec2    far
  63.     pushf            ; save his interrupt state
  64.     cli            ; no distractions
  65.     mov    cs:sssave,ss    ; stash user stack context
  66.     mov    cs:spsave,sp
  67.     mov    cs:axsave,ax    ; save our AX register
  68.  
  69.     mov    ss,cs:dbase    ; set up interrupt stack
  70.     lea    sp,Stktop
  71.     push    ds        ; save for caller
  72.  
  73.     mov    ax,ss
  74.     mov    ds,ax
  75.     mov    ax,2    ; device #2
  76.     push    ax
  77.     mov    ax,cs:axsave    ; Restore AX
  78.     pushf        ; make it look like an INTERRUPT
  79.     call    pkint
  80.     jmp    pkret
  81.  
  82. ; common return for all packet drivers
  83.     label    pkret    near
  84.     pop    ax    ; pop dev # arg
  85.     pop    ds    ; restore for caller
  86.  
  87.     mov    ss,cs:sssave
  88.     mov    sp,cs:spsave    ; restore original stack context
  89.     popf
  90.     retf
  91.  
  92.     end
  93.