p>
mov eax, [hInst]
mov [wc. hInstance], eax
push IDI_APPLICATION
push 0
call LoadIconA
mov [wc. hIcon], eax
push IDC_CROSS
push 0
call LoadCursorA
mov [wc. hCursor], eax
mov [wc. hbrBackground], 0
mov dword ptr [wc. lpszMenuName], 0
mov dword ptr [wc. lpszClassName], offset ClassName
push offset wc
call RegisterClassA
push 0
push [hInst]
push 0
push 0
push 400
push 400
push 100
push 100
push WS_OVERLAPPEDWINDOW
push offset TitleName
push offset ClassName
push 0
call CreateWindowExA
cmp eax, 0
jz _err
mov [hWnd], eax
push SW_SHOWNORMAL
push [hWnd]
call ShowWindow
push [hWnd]
call UpdateWindow
msg_loop:
push 0
push 0
push 0
push offset msg
call GetMessageA
cmp eax, 0
je end_loop
push offset msg
call TranslateMessage
push offset msg
call DispatchMessageA
jmp msg_loop
end_loop:
push [msg. wParam]
call ExitProcess
_err:
jmp end_loop
WndProc proc
push ebp
mov ebp, esp
push ebx
push esi
push edi
cmp dword ptr [ebp +0 ch], WM_DESTROY
je wmdestroy
cmp dword ptr [ebp +0 ch], WM_CREATE
je wmcreate
cmp dword ptr [ebp +0 ch], WM_PAINT
je wmpaint
cmp dword ptr [ebp +0 ch], WM_CHAR
je wmchar
jmp defwndproc
wmchar:
push dword ptr [ebp +10 h]
pop char
push TRUE
push NULL
push dword ptr [ebp +08 h]
call InvalidateRect
wmpaint:
push offset pnt
push dword ptr [ebp +08 h]
call BeginPaint
mov hdc, eax
push 5
push offset clear
push 100
push 100
push hdc
call TextOutA
push 1
push offset char
push 100
push 100
push hdc
call TextOutA
push offset pnt
push eax
call EndPaint
mov eax, 0
jmp finish
wmcreate:
mov eax, 0
jmp finish
defwndproc:
push dword ptr [ebp +14 h]
push dword ptr [ebp +10 h]
push dword ptr [ebp +0 ch]
push dword ptr [ebp +08 h]
call DefWindowProcA
jmp finish
wmdestroy:
push 0
call PostQuitMessage
mov eax, 0
finish:
pop edi
pop esi
pop ebx
pop ebp
ret 16
WndProc endp
lenstr proc
push ebp
mov ebp, esp
push esi
mov esi, dword ptr [ebp +8]
xor ebx, ebx
lbl1:
cmp byte ptr [esi], 0
jz lbl2
inc ebx
inc esi
jmp lbl1
lbl2:
pop esi
pop ebp
ret 4
lenstr endp
_Code ends
end Start