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

  1. ;History:14,1
  2.  
  3. DR_TYPE    equ    99
  4. DR_NAME equ    'Allied Telesis 1700'
  5.  
  6.     include    ecoupler.asm
  7.  
  8.     public    usage_msg
  9. ;    we don't support -d (delay init till first open)
  10. ;    since several of the config parameters come from the device's EEPROM
  11. usage_msg    db    "usage: at1700 [options] <packet_int_no> [io_addr]",CR,LF,'$'
  12.  
  13.     public    copyright_msg
  14. copyright_msg    db    "Packet driver for Allied-Telesis AT-1700, version ",'0'+(majver / 10),'0'+(majver mod 10),".",'0'+version,CR,LF
  15.         db    "Portions Copyright 1993, RF Nets,Cupertino,CA",CR,LF
  16.         db    "Portions Copyright 1993, Crynwr Software",CR,LF,'$'
  17. ;---------------------------------------------------------------------------
  18. ; Ethercoupler specific data items - not needed after driver goes resident
  19. ;---------------------------------------------------------------------------
  20.  
  21.     extrn    flagbyte: byte
  22.  
  23. no_dopt_msg    db    "Error: -d option invalid for AT1700",CR,LF,'$'
  24. no_ec_msg    db    "No AT1700 found",CR,LF,'$'
  25.  
  26.     public    parse_args
  27. parse_args:
  28. ;
  29. ;  Only argument needed is the packet interrupt number.
  30. ;  tail.asm routines took care of that one.  Just need to check that
  31. ;  -d option wasn't specified.
  32. ;
  33. ; exit with nc if all went well, cy otherwise.
  34. ;
  35.     assume    ds:code
  36.     test    flagbyte,D_OPTION    ;delayed init option(-d) present?
  37.     Jz    PA_01
  38.     Mov    DX,offset no_dopt_msg
  39.     Mov    AH,9        ;DOS FC print $ term string
  40.     Int    21h        ;DOS Funct Call
  41.     Stc            ;error!
  42.     Ret
  43.  
  44. PA_01:        ;-d option not found...we're okay
  45.     mov    di,offset io_addr
  46.     call    get_number
  47.     clc
  48.     ret
  49.  
  50. iobtbl    dw    260h,280h,2A0h,240h,340h,320h,380h,300h,0
  51.  
  52. get_board_parameters:
  53. ;   find the ethercoupler adapter
  54.     assume    ds:code
  55.     cmp    io_addr,-1        ;Did they ask for auto-detect?
  56.     je    find_board
  57.  
  58.     mov    di,io_addr
  59.     call    verifyboard
  60.     cmp    ax,0ffffh
  61.     jne    find_board_found
  62.  
  63.     mov    dx,offset no_ec_msg
  64.     stc
  65.     ret
  66.  
  67. find_board:
  68.     mov    si,offset iobtbl    ;Search for the Ethernet address.
  69.     mov    io_addr+2,0
  70. find_board_0:
  71.     lodsw
  72.     mov    io_addr,ax
  73.  
  74.     push    si            ;is it here?
  75.     mov    di,io_addr
  76.     call    verifyboard
  77.     pop    si
  78.  
  79.     cmp    ax,0ffffh        ;did we find it?
  80.     jne    find_board_found    ;yes.
  81.  
  82.     cmp    word ptr [si],0        ;are there any more to look at?
  83.     jne    find_board_0        ;yes.
  84.  
  85.     mov    dx,offset no_ec_msg    ;no, return error.
  86.     stc
  87.     ret
  88.  
  89. find_board_found:
  90.     mov    bmpr13_val,al
  91.     mov    int_no,ah
  92.     clc
  93.     ret
  94.  
  95. code    ends
  96.  
  97. CODESEG        EQU    <code>
  98. DATASEG        EQU    <code>
  99. DATAGROUP    EQU    <code>
  100.     include    eep17.inc
  101.  
  102.     end
  103.  
  104. ; $Log: ecoupler.s%v $
  105. ;Revision 1.3  1993/02/10  06:30:26  N6RCE
  106. ;banner additions
  107. ;
  108. ;Revision 1.2  1993/01/18  03:49:10  N6RCE
  109. ;new recv ISR logic.
  110. ;
  111. ;Revision 1.1  1993/01/17  20:29:38  N6RCE
  112. ;Initial revision
  113. ;
  114.