home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_10 / 2n10006b < prev    next >
Text File  |  1991-07-23  |  1KB  |  37 lines

  1. ;=============================================================================
  2. ;
  3. ;    C32RT0 -- Simple main program for WINMEM32-oriented 32-bit programs
  4. ;
  5. ;    Written by Walter Oney
  6. ;
  7. ;    Note: Define the symbol TGT (with a /d option in the MASM386 command
  8. ;    line for this module) as the name of the target program.
  9. ;
  10. ;=============================================================================
  11.  
  12.         name    c32rt0
  13.         .386
  14.         dosseg
  15.         .model  small,c
  16.         public  __acrtused              ; satisfies demand from compiled code
  17. __acrtused equ  1234h
  18.  
  19. stack   segment dword use32 stack 'stack'
  20.         db      1024 dup (0)
  21. stack   ends
  22.  
  23.         .data
  24. retaddr df      ?                       ; return addr to USE16 caller
  25.         dw      ?                       ; padding for 2d pop instr
  26.  
  27.         .code
  28. astart  proc    far
  29.         pop     dword ptr retaddr       ; preserve 16:32 return addr
  30.         pop     dword ptr retaddr+4     ;   to our USE16 caller
  31.         extrn   TGT:near
  32.         call    TGT                     ; call target program
  33.         jmp     [retaddr]               ; return to original caller
  34. astart  endp
  35.  
  36.         end     astart
  37.