Hello,
The SYSCALL calling convention allows the usage of undecorated symbols. Here is an example.
\PellesC\bin\polib /OUT:kernel32.lib C:\WINDOWS\system32\kernel32.dll
\PellesC\bin\polib /OUT:user32.lib C:\WINDOWS\system32\user32.dll
\PellesC\bin\poasm Window.asm
\PellesC\bin\polink /SUBSYSTEM:WINDOWS Window.obj kernel32.lib user32.lib
; Source code assembled with Pelles Macro Assembler, Version 6.50.0
.386
.model flat,syscall
option casemap:none
include Window.inc
.data
ClassName db "WindowClasss",0
AppName db "Window demo",0
.data?
hInstance dd ?
.code
_start:
_invoke GetModuleHandle,0
mov hInstance,eax
_invoke GetCommandLine
_invoke WinMain,hInstance,NULL,eax,SW_SHOWDEFAULT
_invoke ExitProcess,eax
WinMain PROC hInst:DWORD,hPrevInst:DWORD,CmdLine:DWORD,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:DWORD
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_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
_invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
_invoke RegisterClassEx,<ADDR wc>
_invoke CreateWindowEx,NULL,<ADDR ClassName>,<ADDR AppName>,\
<WS_OVERLAPPEDWINDOW or WS_VISIBLE>,100,\
100,500,400,NULL,NULL,\
hInst,NULL
mov hwnd,eax
_invoke UpdateWindow,hwnd
.WHILE TRUE
_invoke GetMessage,<ADDR msg>,NULL,0,0
.BREAK .IF (!eax)
_invoke TranslateMessage,<ADDR msg>
_invoke DispatchMessage,<ADDR msg>
.ENDW
mov eax,msg.wParam
ret 4*4
WinMain ENDP
WndProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.IF uMsg==WM_DESTROY
_invoke PostQuitMessage,NULL
.ELSE
_invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret 4*4
.ENDIF
xor eax,eax
ret 4*4
WndProc ENDP
END _start