Hi All:
Could someone translate this to Fasm b/c i am beginner in fasm and i really want to start from step one to learn the Fasm assembler.
thx.
----------------------------------------------------------------------------------
.486
.model flat, stdcall
option casemap :none
Main proto :DWORD
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
HelloText db "Hello world!",13,10,0
.data?
hInstance DWORD ?
.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke Main, hInstance
invoke ExitProcess, eax
Main proc hInst:DWORD
invoke StdOut, ADDR HelloText
xor eax, eax
ret
Main endp
end start
----------------------------------------------------------------------------------
Could someone translate this to Fasm b/c i am beginner in fasm and i really want to start from step one to learn the Fasm assembler.
thx.
----------------------------------------------------------------------------------
.486
.model flat, stdcall
option casemap :none
Main proto :DWORD
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
HelloText db "Hello world!",13,10,0
.data?
hInstance DWORD ?
.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke Main, hInstance
invoke ExitProcess, eax
Main proc hInst:DWORD
invoke StdOut, ADDR HelloText
xor eax, eax
ret
Main endp
end start
----------------------------------------------------------------------------------
format PE console
entry start
include "include\kernel32.inc"
include "include\macro\import.inc"
include "include\macro\stdcall.inc"
data import
library kernel32, "kernel32.dll"
kernel32:
import GetModuleHandle, "GetModuleHandleA", \
ExitProcess, "ExitProcess", \
GetStdHandle, "GetStdHandle", \
WriteConsole, "WriteConsoleA"
end data
start:
invoke GetModuleHandle, NULL
mov [hInstance], eax
stdcall Main, [hInstance]
invoke ExitProcess, eax
proc Main, hInst:DWORD
; local variables are defines instead of this comment if needed
enter
stdcall StdOut, HelloText
xor eax, eax
return
proc StdOut, text
bytes_printed dd ?
enter
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov edx, eax
push -1
pop ecx
xor eax, eax
mov edi, [text]
cld
repne scasb
mov ecx, edi
sub ecx, [text]
lea eax, [bytes_printed]
invoke WriteConsole, edx, [text], ecx, eax, NULL
return
HelloText db "Hello world!",13,10,0
hInstance dd ?
Wonderful!
You are welcome.