home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / os2 / programm / 7180 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!chnews!hfglobe!imutm1.de.intel.com!gold.sub.org!jonas.gold.sub.org!rommel
  2. From: rommel@jonas.gold.sub.org (Kai Uwe Rommel)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: 32-bit programming using MASM 6.00b
  5. Distribution: world
  6. Message-ID: <725058405rommel.root@jonas.gold.sub.org>
  7. Sender: root@jonas.gold.sub.org
  8. Date: Tue, 22 Dec 92 22:06:45 MET
  9. References: <1992Dec14.131817.14808@athena.mit.edu> <1992Dec21.173914.8767@athena.mit.edu>
  10. Organization: Private
  11. Lines: 95
  12.  
  13. In article <1992Dec21.173914.8767@athena.mit.edu> jawetzel@athena.mit.edu (The Rottweiler) writes:
  14. >Just in case anyone is interested, the final version of the hello program with
  15. >full segment definitions is included below.  Thanks again for all your help.
  16.  
  17. For *full* segment definitions, you need CODE, DATA, CONST, BSS and
  18. STACK definitions. Example:
  19.  
  20.  
  21.     .386
  22.     INCLUDELIB DOSCALLS.LIB
  23.  
  24.  
  25. CODE    SEGMENT PUBLIC FLAT 'CODE'
  26. CODE    ENDS
  27.  
  28. DATA    SEGMENT PUBLIC FLAT 'DATA'
  29. DATA    ENDS
  30.  
  31. CONST    SEGMENT PUBLIC FLAT 'CONST'
  32. CONST    ENDS
  33.  
  34. BSS    SEGMENT PUBLIC FLAT 'BSS'
  35. BSS    ENDS
  36.  
  37. STACK    SEGMENT STACK FLAT 'STACK'
  38. STACK    ENDS
  39.  
  40. DGROUP    GROUP DATA,CONST,BSS,STACK
  41.     ASSUME CS:FLAT,DS:FLAT,ES:FLAT,SS:FLAT
  42.  
  43.  
  44. STACK    SEGMENT
  45.  
  46.     BYTE    4000H DUP (?)
  47.  
  48. STACK    ENDS
  49.  
  50.  
  51. CONST    SEGMENT
  52.  
  53. message    BYTE    13, 10, "Hello, world.", 13, 10
  54.  
  55. CONST    ENDS
  56.  
  57.  
  58. BSS    SEGMENT
  59.  
  60. count   DWORD    ?
  61.  
  62. BSS    ENDS
  63.  
  64.  
  65. CODE    SEGMENT
  66.  
  67.     EXTERN  DOS32WRITE:PROC
  68.     EXTERN  DOS32EXIT:PROC
  69.  
  70. main    PROC
  71.  
  72.     push    OFFSET count
  73.     push    LENGTHOF message
  74.     push    OFFSET message
  75.     push    1
  76.         call    DOS32WRITE
  77.  
  78.     push    0
  79.     push    1
  80.     call    DOS32EXIT
  81.  
  82. main    ENDP
  83.  
  84. CODE    ENDS
  85.  
  86.  
  87.     END    main
  88.  
  89.  
  90. Build with the commands
  91.  
  92.     ml -c hello32.asm
  93.     link386 /noi /pm:vio hello32;
  94.  
  95. No module definition file needed because the stack is already defined
  96. in the source code.
  97.  
  98.  
  99. Kai Uwe Rommel
  100.  
  101. --
  102. /* Kai Uwe Rommel                                      Muenchen, Germany *
  103.  * rommel@jonas.gold.sub.org                       Phone +49 89 723 4101 *
  104.  * rommel@informatik.tu-muenchen.de                  Fax +49 89 723 7889 */
  105.  
  106. DOS ... is still a real mode only non-reentrant interrupt
  107. handler, and always will be.                -Russell Williams
  108.