home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddrivers.zip / SERIAL / DRVSTART.ASM next >
Assembly Source File  |  1992-07-06  |  1KB  |  68 lines

  1. ;    C startup routine, one device
  2. ;
  3.         EXTRN   _main:near
  4.         EXTRN   _interrupt_handler:near
  5.         EXTRN   _timer_handler:near
  6.         PUBLIC    _STRAT
  7.         PUBLIC  _TIM_HNDLR
  8.         PUBLIC  _INT_HNDLR
  9.         PUBLIC    __acrtused
  10.  
  11. _DATA    segment word public 'DATA'
  12. _DATA    ends
  13.  
  14. CONST    segment word public 'CONST'
  15. CONST    ends
  16.  
  17. _BSS    segment word public 'BSS'
  18. _BSS    ends
  19.  
  20. DGROUP    group CONST,_BSS,_DATA
  21.  
  22. _TEXT    segment word public 'CODE'
  23.      assume cs:_TEXT,ds:DGROUP,es:NOTHING,ss:NOTHING
  24.     .286P
  25. ;
  26. _STRAT    proc    far
  27. __acrtused:            ;no startup code
  28. ;
  29.     push    0
  30.     jmp    start        ;signal device 0
  31. ;
  32. start:
  33.     push    es        ;send Request Packet address
  34.     push    bx
  35.     call    _main        ;call driver mainline
  36.     pop    bx        ;restore es:bx
  37.     pop    es
  38.     add    sp,2        ;clean up stack
  39.     mov    word ptr es:[bx+3],ax ;send completion status
  40.     ret
  41. ;
  42. _STRAT    endp
  43. ;
  44. _INT_HNDLR proc    far
  45. ;
  46.     call    _interrupt_handler ;handle rupts
  47.     ret            ;bail out
  48. ;
  49. _INT_HNDLR    endp
  50. ;
  51. _TIM_HNDLR    proc    far
  52. ;
  53.     pusha
  54.     push    es
  55.     push    ds
  56.     call    _timer_handler
  57.     pop    ds
  58.     pop    es
  59.     popa
  60.     ret
  61. ;
  62. _TIM_HNDLR     endp
  63.  
  64. _TEXT    ends
  65.     end
  66.  
  67.  
  68.