home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / PJ96.ZIP / ALIB.ZIP / ABORT.ASM next >
Encoding:
Assembly Source File  |  1991-08-23  |  454 b   |  32 lines

  1.     include    asm.inc
  2.  
  3.     public    abort_if_cf
  4.  
  5.     .const
  6. ertx_aborting    db    'Aborting',0
  7.  
  8.  
  9.     .code
  10.     extn    get_strerror,perror,set_strerror,exit_with_failure
  11.  
  12.  
  13. ;;    abort if cf
  14. ;
  15. ;    entry    Cf    error flag, program exits if set (Cf==1)
  16. ;
  17. abort_if_cf proc
  18.     jnc    aic2
  19.     call    get_strerror
  20.     jz    aic1
  21.     movx    si,NULL_POINTER
  22.     call    perror
  23. aic1:    lea    ax,ertx_aborting
  24.     call    set_strerror
  25.     call    perror
  26.     call    exit_with_failure
  27. aic2:    ret
  28. abort_if_cf endp
  29.  
  30.  
  31.     end
  32.