home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / os2 / programm / 7085 < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.9 KB  |  70 lines

  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: <724545477rommel.root@jonas.gold.sub.org>
  7. Sender: root@jonas.gold.sub.org
  8. Date: Wed, 16 Dec 92 23:37:57 MET
  9. References: <1992Dec14.131817.14808@athena.mit.edu>
  10. Organization: Private
  11. Lines: 57
  12.  
  13. In article <1992Dec14.131817.14808@athena.mit.edu> jawetzel@athena.mit.edu (The Rottweiler) writes:
  14. >Is there anyone out there who has experience assembling 32-bit OS/2 v2.0
  15. >programs using Microsoft's MASM 6.00b.  I thought that I could use the 
  16. >flat memory model but LINK386 chokes on the object code.  LINK386 does not
  17. >complain if I use the normal segmented model but the EXE created generates
  18. >a 000E trap. 
  19.  
  20. What probably happens is, that you call the *16-bit* DOS calls in your
  21. program. The 32-bit ones are prefixed with Dos32 instead of Dos, i.e.
  22. Dos32Write and so on. Working example:
  23.  
  24. ----------------------------------------------------
  25. .386
  26. .model    flat
  27. .stack    04000H
  28.  
  29. includelib doscalls.lib
  30.  
  31. .data
  32.  
  33. message    byte    13, 10, "Hello, world.", 13, 10
  34.  
  35. .data?
  36.  
  37. count   dword    ?
  38.  
  39. .code
  40.  
  41. extern    DOS32WRITE:proc
  42. extern    DOS32EXIT:proc
  43.  
  44. start   proc
  45.  
  46.     push    offset count
  47.     push    lengthof message
  48.     push    offset message
  49.     push    1
  50.         call    DOS32WRITE
  51.  
  52.         push    27
  53.         push    1
  54.     call    DOS32EXIT
  55.  
  56. start    endp
  57.     
  58.     end    start
  59. ----------------------------------------------------
  60.  
  61. Kai Uwe Rommel
  62.  
  63. --
  64. /* Kai Uwe Rommel                                      Muenchen, Germany *
  65.  * rommel@jonas.gold.sub.org                       Phone +49 89 723 4101 *
  66.  * rommel@informatik.tu-muenchen.de                  Fax +49 89 723 7889 */
  67.  
  68. DOS ... is still a real mode only non-reentrant interrupt
  69. handler, and always will be.                -Russell Williams
  70.