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

  1. ;
  2. ;    C Startup routine for parallel device driver
  3. ;
  4.     EXTRN      _main:near
  5.       EXTRN   _timr_handler:near
  6.       PUBLIC  _STRATEGY
  7.     PUBLIC  __acrtused
  8.       PUBLIC  _TIMER_HANDLER
  9.  
  10. _DATA    segment     word public 'DATA'
  11. _DATA    ends
  12.  
  13. CONST    segment     word public 'CONST'
  14. CONST    ends
  15.  
  16. _BSS    segment     word public 'BSS'
  17. _BSS    ends
  18.  
  19. DGROUP     group     CONST, _BSS, _DATA
  20.  
  21. _TEXT    segment     word public 'CODE'
  22.  
  23.       assume        cs:_TEXT, ds:DGROUP, es:NOTHING, ss:NOTHING
  24.       .286
  25.  
  26. _STRATEGY proc    far
  27. __acrtused:            ;to satisfy C 
  28.  
  29. start:
  30.       push        es    ; &reqpacket high part
  31.       push        bx    ; &reqpacket low part
  32.       call        _main
  33.       pop          bx
  34.       pop          es
  35.       mov          word ptr es:[bx+3],ax  ; plug in status word
  36.       ret
  37. _STRATEGY endp
  38. ;
  39. _TIMER_HANDLER proc     far
  40. ;
  41.       pusha            ;save flags, regs
  42.         push      ds
  43.         push        es    ;make up for the 'almost all' push
  44.       call        _timr_handler ;handle interrupts
  45.         pop          es
  46.         pop       ds
  47.       popa            ;restore everything and
  48.         ret            ;bail out
  49. ;
  50. _TIMER_HANDLER endp
  51.  
  52.  
  53. _TEXT      ends
  54.       end
  55.  
  56.  
  57.