home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / packetdrivers.tar.gz / pd.tar / src / verifypi.asm < prev    next >
Assembly Source File  |  1995-06-25  |  1KB  |  40 lines

  1. signature    db    'PKT DRVR',0
  2. signature_len    equ    $-signature
  3.  
  4. packet_int_msg    db    CR,LF
  5.         db    "Error: <packet_int_no> should be 0x60->0x66, 0x68->0x6f, or 0x78->0x7e",CR,LF
  6.         db    "       0x67 is the EMS interrupt, and 0x70 through 0x77 are used by second 8259"
  7.         db    '$'
  8.  
  9. verify_packet_int:
  10. ;enter with no special registers.
  11. ;exit with cy,dx-> error message if the packet int was bad,
  12. ;  or nc,zr,es:bx -> current interrupt if there is a packet driver there.
  13. ;  or nc,nz,es:bx -> current interrupt if there is no packet driver there.
  14.     cmp    entry_point,60h        ;make sure that the packet interrupt
  15.     jb    verify_packet_int_bad    ;  number is in range.
  16.     cmp    entry_point,67h        ;make sure that the packet interrupt
  17.     je    verify_packet_int_bad    ;  number is in range.
  18.     cmp    entry_point,70h        ;make sure that the packet interrupt
  19.     jb    verify_packet_int_ok    ;  number is in range.
  20.     cmp    entry_point,78h        ;make sure that the packet interrupt
  21.     jb    verify_packet_int_bad    ;  number is in range.
  22.     cmp    entry_point,7eh
  23.     jbe    verify_packet_int_ok
  24. verify_packet_int_bad:
  25.     mov    dx,offset packet_int_msg
  26.     stc
  27.     ret
  28. verify_packet_int_ok:
  29.  
  30.     mov    ah,35h            ;get their packet interrupt.
  31.     mov    al,entry_point
  32.     int    21h
  33.  
  34.     lea    di,3[bx]        ;see if there is already a signature
  35.     mov    si,offset signature    ;  there.
  36.     mov    cx,signature_len
  37.     repe    cmpsb
  38.     clc
  39.     ret
  40.