home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddrivers.zip / MMAP / DDSTART.ASM next >
Assembly Source File  |  1991-05-21  |  1KB  |  48 lines

  1. ;    C Startup routine for OS/2 Device Drivers
  2. ;
  3. ;  1.    Provides the user's "main" routine with the address of
  4. ;    the request packet.
  5. ;    
  6. ;  2.   Defines the segments in the proper order (data, then code)
  7. ;    so if ddstart.obj is included first in the link line, the
  8. ;    segments for the device driver will be ordered correctly.
  9. ;
  10. ;  3.    Satisfies the C EXTRN for __acrtused, which prevents the startup
  11. ;    logic from being included from the standard C library.
  12.  
  13.     EXTRN    _main:near
  14.         PUBLIC    _STRATEGY
  15.     PUBLIC  __acrtused
  16.  
  17. _DATA    segment    word public 'DATA'
  18. _DATA    ends
  19.  
  20. CONST    segment    word public 'CONST'
  21. CONST    ends
  22.  
  23. _BSS    segment word public 'BSS'
  24. _BSS    ends
  25.  
  26. DGROUP    group     CONST, _BSS, _DATA
  27.  
  28. _TEXT    segment    word public 'CODE'
  29.  
  30.       assume    cs:_TEXT, ds:DGROUP, es:NOTHING, ss:NOTHING
  31.       .286P
  32. ;
  33. _STRATEGY proc    far
  34. __acrtused:        ; to satisfy EXTRN in C-generated modules
  35. ;
  36.     push    es        ;send request packet address
  37.     push    bx
  38.     call    _main        ;call driver mailine
  39.     pop    bx        ;restore es:bx
  40.     pop    es
  41.     mov    word ptr es:[bx+3],ax ;send completion status
  42.     ret
  43. ;
  44. _STRATEGY    endp
  45.  
  46. _TEXT      ends
  47.       end
  48.