Please can someone tell me what is a good assembler for developing apps for Windows and for Linux ?
(Have you used the suggested assembler or just know it exists?)
Would I be better off using a dedicated assembler for each platform, ie: MASM for Windows and
'xxx' for Linux ?
(Ideally I dont want to have to code the application twice)
I look forward to the response.
Rgs, Striker.
James,
FASM has the legs here but NASM has been able to do this for years so its a decent contender as well. Just note that it will feel like a very different animal after using MASM.
I vote for FASM
Thanks for the replies.
I have looked at NASM but wonder why people suggest FASM ?
Rgs, Striker.
because it is actively developed and has new features
NASM is outdated
One of the virtues of NASM is that it is apparently part of at least some LINUX distributions so it will be on many linux boxes already. Development in FASM is a lot more active and it is probably a more modern assembler but NASM tends to be a linux industry standard so don't write it off.
I remember that it is possible to run Masm on Linux with an emulator.
Ok, so FASM looks like a good tool.
Plenty of examples for what im needing and it doesnt look like a major jump from MASM.
What debugger is recommended for FASM ?
Thanks again for the feedback/suggestions.
Rgs, striker.
Also look at yasm (http://www.tortall.net/projects/yasm/).
striker,
I have switched completely to the FASM for my Win32 programming needs. For Win32/64 Ollydbg is still the debugger for me. Tomasz has included a series of macros that allow an almost direct use of MASM code in the FASM. The only thing I still miss is the lack of multi-conditional if statements:
if ( a < b) .and. ( c > d )
is not supported. I can't comment on Linux programming, but many use it for Win, DOS, Linux, FreeBSD, OpenBSD and others. And the response time to questions and requests is usually quite timely! The FASM forum is as helpful as this one.
Hope you will enjoy it!!
farrier
I would say go for yasm too.. when it comes to linux.
If you want more general info on linux, aside asm, try www.linux-reactor.com..
Thankyou to everone who replied.
I like FASM a lot and think Ill give it a go.
Does anyone have an example of a Linux SO in FASM that could get me started ?
I found on for Win32 here: http://sulaiman.netadvant.com/fasm/tut_17.html
Update: Ok, downloaded FASM, ran it, liked it !!
Now all I need is an example .SO <- Has someone got one ?
Rgs, striker
Unix Assembly Language (http://www.int80h.org/bsdasm/)
Might be helpful.
Dr,
Thanks for the link. Very interesting.
Im still needing an example of a SO in linux.
From memory of my 'C' days it just a file of exported routines linked a different way.
Id like to see an example to be sure.
Rgs, Striker
.so is just an elf format file. I think this is the type nasm/yasm will output if you specify "-f elf"
(There are actually 3 different types of elf file, which is so helpful :bdg)
Assemble to an ELF and link (ld) with '-shared' switch. Then you can call functions for a dynamicaly loaded library:
handle = dlopen("/mylib.so", RTLD_LAZY);
my_function_hndl = dlsym(handle, "my_function");
my_function_hndl();
dlclose(handle);
edit: also '-soname' ('-soname,mylib.so') switch should be used
arafel,
Thanks for this.
I thought it may be via a link option.
Do you know if there is anything special that has to be done in the module source code?
ie: In a normal "main" you have a "start:" , but is there an entry point in the module is
its going to be a shared library ?
Rgs, striker.
Hi to all....
I don't write well English. But:
Look here.
http://webster.cs.ucr.edu/AsmTools/WhichAsm.html
I think, one good elecctions is HLA.
By(t)e ('-')
nice link thanks.
striker,
I am not sure how this applies for writing shared libs in assembly, but only requirement for gcc compiled shared libs is to have position independent code (-fpic switch). Neither anything specific must be done regarding entry point when making shared lib in C, so I guess it's the same for nasm/fasm. Just exporting needed functions will do the trick.
here is a little nasm example
[attachment deleted by admin]
just found tutorial in nasm documentation about writing shared libraries...
http://alien.dowling.edu/~rohit/nasmdoc8.html#section-8.2
arafel,
Thanks for the link and the zip. Its very helpful of you.
rgs striker.