home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / driver6s / pkterr.asm < prev    next >
Assembly Source File  |  1990-03-13  |  2KB  |  69 lines

  1. ;put into the public domain by Russell Nelson, nelson@clutx.clarkson.edu
  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. errunk    db    "Unknown error",'$'
  19.  
  20. errlist    dw    err0, err1, err2, err3, err4, err5, err6, err7, err8
  21.     dw    err9, err10, err11, err12, err13, err14
  22. error_count    equ    ($ - errlist)/2
  23.  
  24. fatal_error:
  25.     call    print_error
  26.     jnc    fatal_error_1        ;Only terminate if there really
  27.     int    20h            ;  was an error.
  28. fatal_error_1:
  29.     ret
  30.  
  31. print_error:
  32. ;enter with cy set if an error occured, dh is the error number.  If cy
  33. ;  is not set, don't print anything.  Don't change any registers.
  34.     pushf
  35.     jnc    print_error_1
  36.     or    dh,dh
  37.     je    print_error_1
  38.     push    ax
  39.     push    bx
  40.     push    dx
  41.     push    ds
  42.  
  43.     push    cs
  44.     pop    ds
  45.  
  46.     mov    bl,dh
  47.     xor    bh,bh
  48.     mov    dx,offset errunk    ;in case we don't know about it.
  49.     cmp    bl,error_count        ;Do we know about this error number?
  50.     jae    print_error_2        ;  no, bail out.
  51.     shl    bx,1
  52.     mov    dx,errlist[bx]
  53. print_error_2:
  54.     mov    ah,9
  55.     int    21h
  56.  
  57.     mov    al,13            ;crlf.
  58.     call    chrout
  59.     mov    al,10
  60.     call    chrout
  61.  
  62.     pop    ds
  63.     pop    dx
  64.     pop    bx
  65.     pop    ax
  66. print_error_1:
  67.     popf
  68.     ret
  69.