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

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!enterpoop.mit.edu!bloom-picayune.mit.edu!jawetzel
  3. From: jawetzel@athena.mit.edu (The Rottweiler)
  4. Subject: 32-bit programming using MASM 6.00b
  5. Message-ID: <1992Dec14.131817.14808@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: indra.mit.edu
  8. Organization: Massachusetts Institute of Technology
  9. Date: Mon, 14 Dec 1992 13:18:17 GMT
  10. Lines: 86
  11.  
  12. Is there anyone out there who has experience assembling 32-bit OS/2 v2.0
  13. programs using Microsoft's MASM 6.00b.  I thought that I could use the 
  14. flat memory model but LINK386 chokes on the object code.  LINK386 does not
  15. complain if I use the normal segmented model but the EXE created generates
  16. a 000E trap. 
  17.  
  18. Any pointers would be greatly appreciated.
  19.  
  20.                         Jake
  21.  
  22. ------------- hello.asm ------------------------
  23.  
  24.         title    filecomp.asm
  25.  
  26.         .386
  27.  
  28. INCLUDE     hello.inc
  29.  
  30. cr        equ    0dh
  31. lf        equ    0ah
  32.  
  33. stdin        equ    0
  34. stdout        equ    1
  35. stderr        equ    2
  36.  
  37. DGROUP          group     _DATA
  38.  
  39. _DATA         segment dword public use32 'DATA'
  40.  
  41. testmess    db    cr,lf,'Hello World',cr,lf
  42. testmess_len    equ    $-testmess
  43.  
  44. wlen        dw    ?
  45.  
  46. _DATA        ends
  47.  
  48. _TEXT        segment dword public use32 'CODE'
  49.  
  50. main        proc    near
  51.  
  52.         push    stdout
  53.         push    ds
  54.         pushd    offset DGROUP:testmess
  55.         push    testmess_len
  56.         push    ds
  57.         pushd    offset DGROUP:wlen
  58.         call    DosWrite
  59.  
  60.         or    eax,eax
  61.         jnz    error
  62.  
  63.         push    1
  64.         push    0
  65.         call    DosExit
  66.  
  67. error:        push    1
  68.         push    1
  69.         call    DosExit
  70.  
  71. main        endp
  72.  
  73. _TEXT        ends
  74.  
  75.         end    main
  76.  
  77.  
  78. ------------- hello.inc ------------------------------------
  79.  
  80. externdef    DosWrite:near
  81. externdef    DosExit:near
  82.  
  83.  
  84. ------------- hello.def ------------------------------------
  85.  
  86. NAME    HELLO WINDOWCOMPAT
  87. DESCRIPTION "OS/2 2.0 Test Program"
  88. PROTMODE
  89. STACKSIZE 4096
  90.  
  91.  
  92. ------------- assemble commands --------------------------
  93.  
  94. ml /c /Zi /W3 hello.asm
  95. link386 /NOE /NOD /ALIGN:16 /M /DE hello,,,c:\os2\doscalls,hello;
  96.  
  97.  
  98.