Anyone using NASM?
How is it? How about GAS, MASM, TASM?
Printable View
Anyone using NASM?
How is it? How about GAS, MASM, TASM?
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
Got it from manual page.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 '
I'd stay away from gas unless you actually need it. It was meant more as a back-end assembler for the GNU compiler suite, not an every day assembler, so it lacks some of the conveniences of other assemblers. But sometimes you can only accomplish certain things with gas.
When you don't need the special features of gas, I'd use NASM.
Both gas and NASM can produce native object code, so there's no problem using both of them in the same project if you want.