Author Topic: using NASM with RadAsm  (Read 22732 times)

nobody

  • Guest
using NASM with RadAsm
« on: December 09, 2008, 02:56:56 AM »
Hello,

When I try to use RadAsm with NASM I run into the problem that according to the installation instructions (which are very old) I need a number of files that don't seem to come with NASM (anymore?).
The RadAsm instructions tell me to create directories for the linker, libraries and inc's and put the corresponding NASM files there... but the NASM zip only has 2 .exe's and a rdoff directory.

Does anybody have this running and tell me how it is done?

Thank you.

Thijs

nobody

  • Guest
Re: using NASM with RadAsm
« Reply #1 on: December 12, 2008, 08:42:09 PM »
A linker and header files are available here:

http://www.jorgon.freeserve.co.uk/

nobody

  • Guest
Re: using NASM with RadAsm
« Reply #2 on: December 14, 2008, 09:55:52 PM »
Thank you for the link.

Maybe I should ask the following:

What IDE is most commonly used with NASM?

Thank you.

nobody

  • Guest
Re: using NASM with RadAsm
« Reply #3 on: December 15, 2008, 12:55:37 AM »
I'm a "command line guy", and don't use an IDE. If I did, Jeff Owens' AsmIde is the one for Linux... I think RadAsm is probably the most commonly used. The other "popular" one for Nasm would be NaGoA.

http://www.visual-assembler.pt.vu/

I downloaded RadAsm, and the "programming pack" (though I can't run it) to see what was included... expecting to see an "install.txt" with a "For Nasm users" section. Didn't find it. Comments in one example file suggest that Alink (available at SF) and GorC are used (same as NaGoA). GoLink would probably work, too(?).

Nasm doesn't come with a linker - if it did, it'd probably be ld. Dunno if RadAsm would work with ld or not. Try it!

http://www.mingw.org/

Nasm doesn't come with Windows header files, either. The most up-to-date, AFAIK, would be from the Nasmx project (think "MASM32" for Nasm):

http://www.asmcommunity.net/projects/nasmx/

Seems to me they switched from using PoLink to GoLink to get the 64-bit support(?).

Nasm has two ways of making Windows files (three, if you count PEMACS) - "-f obj" (with 32-bit extensions) and "-f win32" (plus "-f win64...). I would consider "-f obj" (the "OMF" format) to be somewhat "obsolete". Borland used it (and you see what happened to them :) The very little Windows programming I've done was mostly using "-f obj" (and you see what happened to me :)

Besides different linkers, the two formats require slightly different source code. "-f obj" defaults to 16-bit code, so the sections all have to be declared as "use32". Section names are arbitrary. Your entrypoint is designated by the "..start:" label - and Nasm knows it's global.

Nasm knows "-f win32" is 32-bit code, and knows section names of ".text", ".data", ".bss", and ".rdata" (arbitrary names treated like ".text). You'll need to declare your entrypoint "global". "WinMain" is common - you'll probably need to tell the linker about your entrypoint, unless you can discover a default it "knows" (like "_start" for Linux ld). There may be a difference in whether you want "call SomeAPI" or "call [SomeAPI]", too...

This doesn't have anything to do with Nasm - about configuring RadAsm to work with HLA - but might give you some clues...

http://webster.cs.ucr.edu/Page_win32/WindowsAsmPgm/html/Ch04.html

Best,
Frank