home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c004 / 4.ddi / NETBIOS / CTAXIT.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-04-18  |  2.1 KB  |  132 lines

  1.     page ,132
  2.  
  3. comment !
  4.  *    aborted application handlers
  5.  *
  6.  *    This program is the CONFIDENTIAL and PROPRIETARY property 
  7.  *    of FairCom(R) Corporation. Any unauthorized use, reproduction or
  8.  *    transfer of this program is strictly prohibited.
  9.  *
  10.  *      Copyright (c) 1987, 1988, 1989 FairCom Corporation
  11.  *    (Subject to limited distribution and
  12.  *     restricted disclosure only.)
  13.  *    *** ALL RIGHTS RESERVED ***
  14.  *
  15.  *    4006 West Broadway
  16.  *    Columbia, MO 65203
  17.  *
  18.  *
  19.  *    c-tree(R)    Version 4.3
  20.  *            Release C
  21.  *            February 7, 1989 17:30
  22.  *
  23. !
  24.     extrn _fdisconnect:far        ;in ctamsg.c or ctamsgx.c
  25.  
  26.     include asm.inc
  27.  
  28.  
  29. CBRK_NONE    = 0
  30. CBRK_DFL    = 1
  31. CBRK_IGN    = 2
  32.  
  33. CERR_NONE    = 0
  34. CERR_DFL    = 1
  35. CERR_FAIL    = 2
  36.  
  37.  
  38. I24FAILBIT    = 8
  39. I24FAILRET    = 3
  40. I24ABORTRET    = 2
  41.  
  42.     CSEG
  43. ;!!!! CODE SEGMENT DATA !!!!
  44. i23_mode    db 0
  45. i24_mode    db 0
  46. i24_passon    dd ?
  47.  
  48. ;
  49. ;void far _set_abort_traps(i23_mode, i24_mode);
  50.  
  51.     assume    ds:DGROUP
  52.     public _set_abort_traps
  53. _set_abort_traps proc far
  54.     push    bp
  55.     mov    bp,sp
  56.     mov    ax,[bp+6]        ;i23_mode
  57.     cmp    ax,CBRK_NONE
  58.     jz    ini1
  59.     mov    i23_mode,al
  60.     push    ds
  61.     push    cs
  62.     pop    ds
  63.     mov    dx,OTX i23_trap
  64.     DOS    2523h
  65.     pop    ds
  66. ini1:
  67.     mov    ax,[bp+8]
  68.     cmp    ax,CERR_NONE
  69.     jz    ini2
  70.     mov    i24_mode,al
  71.     DOS    3524h
  72.     mov    WO i24_passon,bx
  73.     mov    WO i24_passon+2,es
  74.     push    ds
  75.     push    cs
  76.     pop    ds
  77.     mov    dx,OTX i24_trap
  78.     DOS    2524h
  79.     pop    ds
  80. ini2:
  81.     pop    bp
  82.     ret
  83. _set_abort_traps endp
  84.  
  85.     assume    ds:nothing
  86.  
  87.     public i23_trap
  88. i23_trap proc far
  89.     sti
  90.     cmp    i23_mode,CBRK_IGN
  91.     jnz    cct1
  92.     iret
  93. cct1:    call    discon            ;note, we are on C's stack
  94.     stc
  95.     ret                ;(dos cleans int flags from stack)
  96. i23_trap endp
  97.  
  98.     public i24_trap
  99. i24_trap proc far
  100.     sti
  101.     cmp    i24_mode,CERR_DFL
  102.     jz    ce1
  103.     test    ah,I24FAILBIT
  104.     jnz    ce1
  105.     mov    al,I24FAILRET
  106.     iret
  107. ce1:    pushf
  108.     cli
  109.     call    i24_passon
  110.     cmp    al,I24ABORTRET
  111.     jnz    ce2
  112.     call    discon            ;note, we are on C's stack
  113. ce2:    iret
  114. i24_trap endp
  115.  
  116.     public discon
  117. discon:
  118.     PUSHM    <ax,bx,cx,dx,si,di,bp,ds,es>
  119.     mov    ax,DGROUP
  120.     mov    ds,ax
  121.     assume ds:DGROUP
  122.  
  123.     call    _fdisconnect
  124.  
  125.     POPM    <es,ds,bp,di,si,dx,cx,bx,ax>
  126.     assume ds:nothing
  127.     ret
  128.  
  129.     END_MOD
  130.     end
  131.  
  132.