home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / PPPBCKP / SRC / SRC15B87.ZIP / TERMIN.ZIP / PKTERR.ASM < prev    next >
Assembly Source File  |  1998-01-17  |  2KB  |  70 lines

  1. ;put into the public domain by Russell Nelson, nelson@crynwr.com
  2.  
  3. err0    db    "No error at all.",'$'
  4. err1    db    "Invalid handle number",'$'
  5. err2    db    "No interfaces of specified class found",'$'
  6. err3    db    "No interfaces of specified type found",'$'
  7. err4    db    "No interfaces of specified number found",'$'
  8. err5    db    "Bad packet type specified",'$'
  9. err6    db    "This interface does not support multicast",'$'
  10. err7    db    "This packet driver cannot terminate",'$'
  11. err8    db    "An invalid receiver mode was specified",'$'
  12. err9    db    "Operation failed because of insufficient space",'$'
  13. err10    db    "The type had previously been accessed, and not released.",'$'
  14. err11    db    "The command was out of range, or not implemented",'$'
  15. err12    db    "The packet couldn't be sent (usually hardware error)",'$'
  16. err13    db    "Hardware address couldn't be changed (more than 1 handle open)",'$'
  17. err14    db    "Hardware address has bad length or format",'$'
  18. err15    db    "Couldn't reset/initialize interface (more than 1 handle open)",'$'
  19. err16    db    "An invalid iocb was specified",'$'
  20. errunk    db    "Unknown error",'$'
  21.  
  22. errlist    dw    err0, err1, err2, err3, err4, err5, err6, err7, err8
  23.     dw    err9, err10, err11, err12, err13, err14, err15, err16
  24. error_count    equ    ($ - errlist)/2
  25.  
  26. fatal_error:
  27.     call    print_error
  28.     jnc    fatal_error_1        ;Only terminate if there really
  29.     int    20h            ;  was an error.
  30. fatal_error_1:
  31.     ret
  32.  
  33. print_error:
  34. ;enter with cy set if an error occured, dh is the error number.  If cy
  35. ;  is not set, don't print anything.  Don't change any registers.
  36.     pushf
  37.     jnc    print_error_1
  38.     or    dh,dh
  39.     je    print_error_1
  40.     push    ax
  41.     push    bx
  42.     push    dx
  43.     push    ds
  44.  
  45.     movseg    ds,cs
  46.  
  47.     mov    bl,dh
  48.     xor    bh,bh
  49.     mov    dx,offset errunk    ;in case we don't know about it.
  50.     cmp    bl,error_count        ;Do we know about this error number?
  51.     jae    print_error_2        ;  no, bail out.
  52.     shl    bx,1
  53.     mov    dx,errlist[bx]
  54. print_error_2:
  55.     mov    ah,9
  56.     int    21h
  57.  
  58.     mov    al,13            ;crlf.
  59.     call    chrout
  60.     mov    al,10
  61.     call    chrout
  62.  
  63.     pop    ds
  64.     pop    dx
  65.     pop    bx
  66.     pop    ax
  67. print_error_1:
  68.     popf
  69.     ret
  70.