Hi!

Just installed RadASM, and think I got NASM support to work. I noticed, though, that when starting a new NASM project, the only project type available was Win32, whilst MASM had numerous other options. Why is this? Am I missing something by going with NASM?

!me
Posted on 2010-04-21 17:30:16 by !me
Um, I can't seem to edit my original post, sorry for the double post.

Maybe I have downloaded the wrong NASM version? RadASM has set up paths to "nasmw", "alink", "cvtres" and "gorc", programs that are not found in my NASM download. The only thing I have is "nasm" (assembler, I assume) and "ndasm" (disasm). There is also an "rdoff" directory with some other programs (utilities?)

I am sorry for having to ask a question like this. I would have thought I could find the answer by searching, but I couldn't find anything so I hope any of you NASM-users could help. RadASM looks nice, by the way :) I'm looking forward to getting it up and running.
Posted on 2010-04-21 19:08:10 by !me
Mmmm... I'm fairly familiar with Nasm, but don't know RadAsm much. I can answer part of your question, at least. At one time, Nasm was distributed with two executables in with the source code, one for dos and one for Windows. To distinguish between them, the Windows version was named "nasmw.exe". This is no longer the case - it's just named "nasm.exe" now. There's no difference but the name. If it turns out to be easier to "ren nasm.exe nasmw.exe" than to change the paths in RadAsm, that should work.

Alink is available at http://alink.sf.net - it is one of several linkers that can be used with Nasm to produce executables.

Gorc is Jeremy Gordon's resource compiler. Available from http://www.godevtools.com While you're there, you might d/l his "GoLink", too - another of the linkers that'll work. Dunno if it plays nicely with RadAsm or not...

I'm not familiar with "cvtres" - a Microsoft program? OpenWatcom seems to have a version of it, too... Dunno.

Nasm has multiple output formats (specified on the command line with the "-f" switch). Three of them - four if you count 64-bit - might be suitable for Windows executables. "-f obj" defaults to 16-bit, so you have to declare each section as "use32" - kind of a PITA (especially if you forget! :) ). It atones for it by accepting the "import" directive, which allows you to link without "win32.lib". "-f win32" (*very* latest versions of Nasm accept "-f win" as an alias...) is the more "modern" output format for Windows, and is probably what you want - if it's compatible with your linker, and if you can figure out how to get RadAsm to produce that command line. "-f bin" will also produce a Windows executable, but requires generating the header(s) in the source code - doable, but probably not what you want. If one of the options in RadAsm is a dos file, rather than Windows, you might want "-f bin".

If you can (easily) customize the command line RadAsm hands to Nasm, you might want to add "-Ox", if it isn't there, to get Nasm to use shorter instructions, where available. That's probably all you need - plus the "-f" switch... You can probably delete the whole rdoff directory without missing it.

For anything beyond that, you need help from a RadAsm user! :)

Best,
Frank

Posted on 2010-04-21 20:15:55 by fbkotler
Radasm is completely customizable, and supports 'whatever' compiler/assembler/linker u want
its just a cool editor with lots of flex
u can use it for c if u wanna, or whatever
Posted on 2010-04-22 01:05:25 by Homer
Thanks for your replies, guys. From your post, Frank, it seems like I will have to set up RadASM manually for other projects than the default Win32. In worst case I'll just use some text editor and the command line for those cases. I downloaded the NASM manual, so I should be able to figure it out without too much problem ;)

Thanks for the links as well. I already have GCC installed, but I guess it might be safer to get the default tools.
Still not sure about cvtres, hopefully someone knows what this is, and why RadASM by default wants it for NASM. A google search gave

"Microsoft® Resource File To COFF Object Conversion Utility, associated with Microsoft® Visual Studio® 2005 from Microsoft Corporation."

I don't know where it should be downloaded, or if it is legal to download it for free.
Posted on 2010-04-22 08:51:33 by !me
I downloaded alink and gorc, and found some version of the windows resource compiler which should work with windows 7.

When I try to build an example project, I get this error: "WinDlg.asm:28: fatal: unable to open include file `\nasm\inc\win32n.inc'"

What's wrong with my NASM download? I got no include-files whatsoever.. No libraries, either..
Posted on 2010-04-22 10:47:27 by !me
Is it possible to edit posts? I feel stupid triple posting...

I downloaded a version of win32n.inc, hoping that I won't need to download a lot more of those include files later.. I still got the error, but when changing the include statement to the absolute path to the file, it worked. Don't know why, the paths should be correct.. Where does RadASM look for include files, if not in the $I dir?

Anyway, it turns out I also needed Win32.lib, so I downloaded a version of that too from some random site. After messing a bit with the nasm.ini file, I got my example Win32 project to build without errors. The problem is that executing the generated (PE) executable doesn't seem to do anything...  :sad:

EDIT: I can now edit posts, just needed 5 posts it seems.

EDIT 2: Forget it, now it works.. Don't know quite why, but it does. :) Sorry for bothering y'all with n00b questions like this, but I was desperate o.O

I'll look at the NASM manual and see if I can customize the nasm.ini to make more project templates for lib, dll etc. projects. ;)

EDIT 3: If anyone is interested, I got the include files to work by adding "-i $I\" to lines in nasm.ini where assembling was done. Tells the assembler to search for include files in the $I dir

Posted on 2010-04-22 11:21:30 by !me