I create a simple FASM project using EasyCode IDE.
It generate a asm source file:Project1.asm:
section '.data' data readable writeable
hInst dd 0
szClassName db 'EasyCode2MainWindow', 0
szTitle db 'Main Window', 0
szRiched20 db 'riched20.dll', 0
section '.text' code readable executable
proc start
invoke GetModuleHandle, NULL
mov [hInst], eax
invoke GetCommandLine
stdcall WinMain, [hInst], NULL, eax, SW_SHOWDEFAULT
invoke ExitProcess, eax
endp
proc WinMain hInstance:DWORD, hPrevInst:DWORD, lpCmdLine:DWORD, nCmdShow:DWORD
local msg:MSG
local wc:WNDCLASSEX
local icc:INITCOMMONCONTROLSEX ;Remove this line if common controls are not going to be used
local hRichEdit:DWORD ;Remove this line if Rich Edit control is not going to be used
;=========================================================================
;Remove these lines, and the corresponding 'comctl32.dll' dynamic library
;from project explorer, only if you are not going to use common controls
mov [icc.dwSize], sizeof.INITCOMMONCONTROLSEX
mov [icc.dwICC], 03FFFH
lea eax, [icc]
invoke InitCommonControlsEx, eax
;=========================================================================
;=========================================================================
;Remove these lines, and the corresponding 'riched20.dll' dynamic library
;from project explorer, only if you are not going to use rich edit control
invoke LoadLibrary, szRiched20
mov [hRichEdit], eax
;=========================================================================
mov [wc.cbSize], sizeof.WNDCLASSEX
mov [wc.style], CS_DBLCLKS
mov [wc.lpfnWndProc], WindowProcedure
mov [wc.cbClsExtra], 0
mov [wc.cbWndExtra], 0
mov eax, [hInst]
mov [wc.hInstance], eax
mov [wc.hIcon], NULL
invoke LoadImage, NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, (LR_DEFAULTSIZE OR LR_LOADMAP3DCOLORS OR LR_SHARED)
mov [wc.hCursor], eax
mov [wc.hbrBackground], (COLOR_BTNFACE + 1)
mov [wc.lpszMenuName], NULL
mov [wc.lpszClassName], szClassName
mov [wc.hIconSm], NULL
invoke RegisterClassEx, addr wc
invoke CreateWindowEx, 0, szClassName, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, [hInst], 0
push eax
invoke ShowWindow, eax, [nCmdShow]
pop eax
invoke UpdateWindow, eax
@@: invoke GetMessage, addr msg, NULL, 0, 0
cmp eax, 0
jle @f
invoke TranslateMessage, addr msg
invoke DispatchMessage, addr msg
jmp @b
;=========================================================================
;Remove these lines, and the corresponding 'riched20.dll' dynamic library
;from project explorer, only if you are not going to use rich edit control
@@: .if [hRichEdit] <> NULL
invoke FreeLibrary, [hRichEdit]
.endif
;=========================================================================
invoke DestroyCursor, [wc.hCursor]
invoke UnregisterClass, szClassName, [hInst]
mov eax, [msg.wParam]
ret
endp
proc WindowProcedure hWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
.if [uMsg] = WM_CREATE
;===================
; Initalization code
;===================
xor eax, eax
L2: ret
.elseif [uMsg] = WM_DESTROY
;===========
; Final code
;===========
invoke PostQuitMessage, 0
xor eax, eax
jmp L2
.endif
invoke DefWindowProc, [hWnd], [uMsg], [wParam], [lParam]
jmp L2
endp
In the IDE,this code compiles OK,but when I compile this file using command line ,it compiles failed.
And I notice the included files in the project explore window,I wander how the IDE manage these include files to work?
Thanks