listen.asm
上传用户:xiaoan1112
上传日期:2013-04-11
资源大小:19621k
文件大小:2k
源码类别:

操作系统开发

开发平台:

Visual C++

  1. INCLUDE         model.inc
  2. INCLUDE         fastlynx.inc
  3.                 .DATA
  4.                 EXTRN   last_operation:BYTE
  5.                 PUBLIC  FirstListen
  6. FirstListen     db      1
  7. StartTicks      dw      ?
  8.                 
  9.          .CODE text
  10.                 PUBLIC  ResetListenTime
  11.                 EXTRN   FxRestorePorts:NEAR
  12.                 EXTRN   FxInitPorts:NEAR
  13.                 EXTRN   GetTicks:NEAR
  14.                 EXTRN   SetPortInfo:NEAR
  15.                 EXTRN   GetPortInfo:NEAR
  16. ResetListenTime PROC    NEAR
  17.                 call    GetTicks
  18.                 mov     StartTicks, ax
  19.                 ret
  20. ResetListenTime ENDP
  21. FxListen        PROC    FAR PASCAL
  22. ;* extern int _pascal FxListen(void);
  23.                 cmp     FirstListen, 1
  24.                 jne     no_reset
  25.                 call    ResetListenTime
  26.                 mov     FirstListen, 0
  27. no_reset:       xor     bx, bx
  28. listen_loop:    cmp     bx, fx_tail
  29.                 jae     fail
  30.                 call    GetPortInfo
  31.                 call    fx_listen_vector[bx]
  32.                 jnc     success
  33.                 inc     bx
  34.                 inc     bx
  35.                 jmp     listen_loop
  36. fail:           call    GetTicks
  37.                 sub     ax, StartTicks
  38.                 cmp     ax, FxSettings.FxSettingsDef.fxs_time_out
  39.                 jl      no_timeout
  40.                 call    FxInitPorts
  41. no_timeout:     xor     ax, ax
  42.                 ret
  43. success:        call    SetPortInfo
  44.                 call    FxRestorePorts
  45.                 mov     last_operation, RECV_OPERATION
  46.                 mov     ax, 1
  47.                 ret
  48. FxListen        ENDP
  49.             END