Re: Printing from MASM (and other droll questions)



Here is a version that works from the masm32 project that your
includes assume. MessageBox is in USER32.DLL so I added the include
and lib, I added the entry point so masm knows where to start the
application and it is matched by the "end entry_point" directive so
masm knows where the file end is.

You don't need to terminate a string with ascii 13 or 10 unless you
need the next line with text on it. 10 works but DOS/Windows standard
is still 13,10 so its more reliable in more places.


.486
.model flat, stdcall
option casemap :none

include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\masm32.lib

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

..data
helloString db "Hello World ",33, 0

..code

entry_point:

fn1 proc
invoke MessageBox, NULL, addr helloString, addr
helloString,MB_OK
;; invoke StdOut, addr helloString
ret
fn1 endp

end entry_point

-------------------------

You can get help on masm at the masm forum at www.masm32.com

Regards,

hutch at movsd dot com.
.



Relevant Pages

  • Re: Printing from MASM (and other droll questions)
    ... MessageBox is in USER32.DLL so I added the include ... masm knows where the file end is. ... invoke MessageBox, NULL, addr helloString, addr ...
    (alt.lang.asm)
  • Re: Printing from MASM (and other droll questions)
    ... MessageBox is in USER32.DLL so I added the include ... masm knows where the file end is. ... invoke MessageBox, NULL, addr helloString, addr ...
    (alt.lang.asm)
  • Re: MASM32 help
    ... If you are working with MASM on a Windows32 platform you may ... MASM along with other assembly language literature, ... C:\hello.asm: error A2034: must be in segment block ...
    (comp.lang.asm.x86)