Ok I am just learning ASM so please correct me if I am making a stupid mistake.

I am using the nasm assembler for linux to compile my ASM projects.

Is this a big mistake or what? :-/

Here is a simple piece of code that does nothing but for some reason refuses to assemble no matter what assembler I use:

.MODEL SMALL
.STACK 200H
.CODE
START:

END START
Posted on 2009-08-07 01:13:45 by David2010
That code isn't building because that code is not NASM source. If you plan to use that variant of syntax I would suggest using JWASM as it's currently the closest MASM clone that is available for Linux.

    .386
    .model flat

    include /usr/share/jwasm/includes/stdio.h
    include /usr/share/jwasm/includes/stdlib.h

    .data

msg  db "jwasm on linux!",10
    db "Press any key to continue...", 10

    .code

_start:
    invoke puts, offset msg
    invoke fgetc, STDIN
    invoke exit, 0

end _start


Unfortunately, atm, for JWASM you'll have to create your own stdlib headers. I'm working on general purpose JWASM headers in my spare time, but they won't be reliable for distribution for a good while.

For NASM, I suggest checking the NASMX project and look over any sample code included.

Posted on 2009-08-07 05:09:32 by Synfire