Originally Posted by
EVOEx
I kind of like nasm. But I did have some problems writing windows applications with it. With masm this is really easy, but I hate the forced stupid bloated microsoft syntax that comes with it. The others I don't know.
My advise is to try nasm first. Nice, plain syntax that assembly should be. Unless of course you like the ms syntax...
Any tutorial/something that may help a newbie?
I've downloaded nasm-2.06rc1 from sf.net and trying to compile this one but it says:
test.asm:4: error: parser: instruction expected
Code:
section .text
extern _MessageBoxA@16
%if __NASM_VERSION_ID__ >= 0x02030000
safeseh handler ; register handler as "safe handler"
%endif
handler:
push DWORD 1 ; MB_OKCANCEL
push DWORD caption
push DWORD text
push DWORD 0
call _MessageBoxA@16
sub eax,1 ; incidentally suits as return value
; for exception handler
ret
global _main
_main:
push DWORD handler
push DWORD [fs:0]
mov DWORD [fs:0],esp ; engage exception handler
xor eax,eax
mov eax,DWORD[eax] ; cause exception
pop DWORD [fs:0] ; disengage exception handler
add esp,4
ret
text: db 'OK to rethrow, CANCEL to generate core dump',0
caption:db 'SEGV',0
section .drectve info
db '/defaultlib:user32.lib /defaultlib:msvcrt.lib '
Got it from manual page.