Re: MASM32 vs NASM
From: Frank Kotler (fbkotler_at_comcast.net)
Date: 10/24/03
- Next message: arargh310NOSPAM_at_NOW.AT.arargh.com: "Re: Executable Header"
- Previous message: Alex McDonald: "Re: Executable Header"
- In reply to: Mário Lopes: "MASM32 vs NASM"
- Next in thread: Randall Hyde: "Re: MASM32 vs NASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Oct 2003 00:12:34 GMT
Mário Lopes wrote:
> Hello there!
>
> I've started programming ASM (x86) due to a class i have on faculty.
> Unfortunately, the teacher uses MASM32 and win32 code-specific instructions
> like invoke and others, as wells as win32 libraries. The problem is that i
> only use Linux and i would rather continue doing it. So i would like to how
> can i program asm on linux using win32 libraries or something similiar to
> emulate MASM32..
>
> Thanks in advance and best regards!
>
Hi Mário,
Unless you're running a Windows emulator, win32 libraries won't do you
much good on Linux :) As you know, Nasm doesn't have any of that "high
level stuff" built in. You can "%include" macro files to get "invoke"
and "if" and "while" and "switch/case" and all that. You wouldn't want
"invoke" for Linux anyway - you want something that does syscalls. Get
the "asmutils" package from http://linuxassembly.org and I think you'll
find macro files that do pretty much what you want. You can write code like:
%include "system.inc"
sys_open filename, O_RDONLY
sys_read eax, buffer, BUF_SIZ
sys_write STDOUT, buffer, BUF_SIZ
sys_exit 0
If those files don't give you all the Masm-like functionality you want,
you may need to include other files, or cut-and paste a "custom" job.
Nasm's macro syntax is horrid - like Gas on bad acid - I'd cut-and-paste
macros others have written, rather than write my own, where possible :)
I don't think there's any question that Masm's macro capabilities are
better than Nasm's, but you should be able to do most of the same things
with Nasm. If you want something "Windows-like" in the sense of a GUI,
Numa has posted a couple Xwindows examples:
Xlib sample
1. http://mipagina.cantv.net/porrasgarcia/xl.tar.gz
2. GTK samples
http://mipagina.cantv.net/porrasgarcia/gnometest.zip
http://mipagina.cantv.net/porrasgarcia/gnometest.tar.gz
To be honest, I haven't had a chance to look at 'em. There may be
something there that would interest you. Worth noting that HLA runs on
Linux (Fasm, too) - perhaps that would be what you want. Whatever you
do, don't abandon Linux just for MASM32... we'll think of something!
Best,
Frank
- Next message: arargh310NOSPAM_at_NOW.AT.arargh.com: "Re: Executable Header"
- Previous message: Alex McDonald: "Re: Executable Header"
- In reply to: Mário Lopes: "MASM32 vs NASM"
- Next in thread: Randall Hyde: "Re: MASM32 vs NASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|