;-hello.asm------------------------------------------------------------------ ; x86 - Dos & Win32 - Assembly Language Programming ; ; ; ; Written by: John A Lyons ; ; Email : sysop@megablast.8k.com ; ; Page : http://www.asmsource.8k.com/ ; ; Compiler : Masm32 v6.13 Microsoft Macro Assembler ; ; Date : 23-Dec-2000 ; ; Purpose : Demonstrate a simple win32 program. Opens a window ; ; and prints out Hello World. ; ; ; ;---------------------------------------------------------------------------- ; Compile with nmake ; ; or ; ; C:\MASM32\!ME\HELLO>ml /c /coff /Cp /Ic:\masm32\include hello.asm ; Microsoft (R) Macro Assembler Version 6.13.7299 ; Copyright (C) Microsoft Corp 1981-1997. All rights reserved. ; ; Assembling: hello.asm ; ; C:\MASM32\!ME\HELLO>Link /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib hello.obj ; Microsoft (R) Incremental Linker Version 5.12.8078 ; Copyright (C) Microsoft Corp 1992-1998. All rights reserved. ; .386 ; 32-Bit when .386 appears before .MODEL .MODEL FLAT , STDCALL include windows.inc include user32.inc include kernel32.inc include gdi32.inc includelib user32.lib includelib kernel32.lib includelib gdi32.lib .data ClassName db "SimpleWinClass",0 AppName db "Hello!",0 TestString db "Hello World",0 .data? hInstance HINSTANCE ? CommandLine LPSTR ? hwnd HWND ? .code WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:SDWORD LOCAL wc:WNDCLASSEX LOCAL msg:MSG mov wc.cbSize,SIZEOF WNDCLASSEX mov wc.style, CS_HREDRAW or CS_VREDRAW mov wc.lpfnWndProc, OFFSET WndProc mov wc.cbClsExtra,NULL mov wc.cbWndExtra,NULL push hInstance pop wc.hInstance mov wc.hbrBackground,COLOR_WINDOW+1 mov wc.lpszMenuName,NULL mov wc.lpszClassName,OFFSET ClassName invoke LoadIcon,NULL,IDI_APPLICAT