![]() |
| | #1 |
| Ugly C Lover Join Date: Jun 2008 Location: Indonesia
Posts: 479
| How is it? How about GAS, MASM, TASM?
__________________ Just GET it OFF out my mind!! |
| audinue is offline | |
| | #2 |
| Registered User Join Date: Oct 2008
Posts: 563
| 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... |
| EVOEx is offline | |
| | #3 | |
| Ugly C Lover Join Date: Jun 2008 Location: Indonesia
Posts: 479
| Quote:
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 '
__________________ Just GET it OFF out my mind!! | |
| audinue is offline | |
| | #4 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| 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.
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot |
| brewbuck is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NASM 'import' directive failing with "Expected an instruction" error? | hauzer | Windows Programming | 3 | 04-26-2009 05:59 AM |
| What's wrong with my Allegro? | kooma | Game Programming | 4 | 12-28-2007 02:42 AM |
| More with NASM | Lurker | A Brief History of Cprogramming.com | 3 | 11-13-2003 05:28 PM |
| Asm + C++ | JaWiB | C++ Programming | 17 | 06-26-2003 03:13 PM |
| Getting a return value from a DLL in (N)ASM | dirkduck | C++ Programming | 2 | 08-02-2002 02:13 AM |