Which Assembler is Recommended?

I'm returning to assembly programming after a long hiatus (anyone remember 286 assembly...?), and I'm wondering which (modern) assembler would be best for the following requirements:

- 32-bit and possibly 64. I assume that the only important difference is that the latter allows access to the full memory on those machines which may have more than 4 gigabytes, or am I missing something? Why do most people seem to be using 32-bit? In other words, is there a compelling reason to use one over the other?
- a format (syntax etc) which is reasonably standard

I was going to use MASM, but then I noticed the following bizarre requirement in the license agreement: "You cannot use the MASM32 Project to write software for Non-Microsoft Operating Systems."
Although my project will initially use Windows, nonetheless I may need to convert it later into a free-standing program that serves as an OS in its own right. If that becomes desirable, I don't want to have to tediously convert from one assembler format to another.

I'm still learning about the modern changes (floating point registers? No segment headaches?) and feeling a bit like a time-traveller from the distant past... so I'm hoping people will bear with me if my questions are naive.
Thank you for your advice.


  • If you are starting over more or less from the beginning, I recommend Borland TASM and Turbo Debugger. You can use the Ideal mode and the MASM mode, compare them, and learn even more from running a program through debugger after you assemble.

    I doubt if there are distribution problems -- you would have to look at the fine print.

    You can get all the old versions of TASM from 1.0 to 5.0 on the net using Google. The cost is nothing or very small amounts. It will meet all your needs for 16 bit programming, and most of what you need to start on 32 bit programming.

    Currently most people recommend the A86-D86 website and the HLA website for the latest. They are great. They do cost a little, but are not extravagant at all. But I don't recommend tackling that level until you feel very confident with small programs.

    I think these websites are where you can start if you want to look into 64 bit programming. I don't know why people do that. It could be related to the latest in chip developments, but that is very advanced work.

    These websites are also very good for online learning - from restart to very advanced.

    If you work on a PC, I would not recommend messing with Windows Vista, but earlier versions are OK in either console mode or windows mode.
    You could also consider one or another of the many flavors of unix.

    Unix has the additional benefit that lots of modern libraries are availble as Free Software - GNU and other sites. Most of this is also ported to windows - certainly everything you need for starting over.

    If you prefer books to online learning, try the books by Tom Swan on Turbo Assembler. They are from the 1990's but still very good tutorials for starting over. They are available from out of print sources and are not usually costly.

    The best reference I know of up to the year 2000 is by S. Dandamudi on Assembly Language Programming. Certainly covers 32 bit issues and Pentium level chip issues. VERY comprehensive, but not easy to read. Might not be good alone as a learning tool but might do well as a reference along with other books.

    There are lots of newer books on ASM programming. Many of them have rave reviews. I just have not had time to read any of them yet.

    Hope this helps. It can be fun and instructive programming practice.

  • Thank you for your reply. I can look into your recommendations.
    I wouldn't say that I'm "starting over from the beginning", however. The changes since the 286 are mainly things which make assembly far easier - continuous memory addressing rather than fiddling with the segment registers and 640k limit; the use of floating-point registers rather than being forced to devise your own method of handling floating-point math, etc. I still "think" in terms of assembly, so the language isn't the problem. I just need to find a good assembler to use, and decide whether I need to use 64-bit or not.
    I should have mentioned that I'll need to save program chunks which will then be loaded at run-time by a program written in C++ and inline assembly. I've already written a variation of the latter, which currently converts my own simple language into machine code but I decided to scrap that and just load pre-compiled machine code generated by an assembler. I'd rather generate the machine code from assembly source code, to allow better optimization and because I'm still more comfortable with assembly than with C++. Hence I'm looking for a good assembler.

  • [color=Blue]Turbo Debugger?! TASM?!
    Ancient history!

    Best tool in that business is FASM, because it is the easiest to use. Also, the debugger is OllyDbg - awesome tool!

  • I agree. TASM is hard to find on the net, no longer maintained, doesn't support 64-bit, has a lot of useless assembler directives and a few annoying bugs and there's no source available to fix it, so I'd keep away from it. I can't say much about HLA, I've never used it and I don't know anyone that does, but I've heard good and bad about it.

    About 64-bit development, 64-bit programs tend to run slightly faster (if done properly) thanks to the additional registers and larger register size. Also, more than 4 GB of memory can be addressed directly if needed. Although 32-bit programs will run under a 64-bit environment as well, so it's not strictly necessary to move to 64-bit in the near future.

    I've found MASM32 to be the best for doing larger Windows programs. It doesn't support 64-bit, but it's actively maintained and has very good macros and options for Windows development. However, you'd still typically use C to do larger projects anyway.

    FASM and NASM can do pretty much anything you need. Both can do 64-bit, are actively maintained/developed, they have simple and logical directives and Linux ports are available. All assemblers have slight differences in syntax, but most still use the standard Intel style.

    For learning asm I'd suggest [link=http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html]The Art of Assembly[/link] by Randall Hyde.
  • You are right. You are way beyond starting over. If you already think in assembler, stay with it. (It also means you have developed rather incredible patience, which is needed for working at that level. But you can do about anything you want to at that level and you can optimze almost anything as well.)

    The current buzz is mostly about FASM (Flat Assembler) because of ease of addressing.
    There is buzz about NASM - apparently serious developers make use of the distributed processing featurers.
    There is still a little buzz about HLA - possibly because of tutorial features which you may not need.
    I have not used these and don't know about practical experience or distribution rights issues.

    I have started on the book by Hyde. It is way newer than anything I have read so far and seems to be very good - but I haven't finished enough to comment.
    BTW - Randall Hyde is the person doing the writing and the teaching on the HLA website.

    There seem to be lots of people who stick with good old MASM - I don't know how they deal with distribution issues.

    I work at the hobbyist level.
    I have moved more towards C and C++ because my research heavily involves numerical approximation and other simulation issues.

    There is just way more stuff on the web and in print that I can use for help that is written in C and C++. In a pinch I can even translate from Fortran - there are lots of engineers who still use it and do great work in simulations.

    Although I don't now have much time left for the assembler as a learning discipline - I dip into it once in a while for a change of pace. I not only try a little improving with inline assembler, but I have even tried calling C and C++ functions from assembler.

    I can do it. I am not sure it accomplishes anything beyond the teaching points.
    I use mostly minGW for my "work."
    I still have a lot of Borland tools that I fall back on when I need to learn about assembly level issues and that's proved to be an easy way to experiment with stuff (TASM, TD, C and C++, 16 and 32 bits).

    If you don't have them (Turbo tools), it may not pay to hunt around for them.
    Concentrate on trying out the newer stuff (and it will get you from 16 bits all the way to 64 bits if you need it).

    Those new registers and piplines in the "cray on a desktop" chips are very appealing because of speed, which ultimately helps greatly in numerics. There is just an awful lot of building I have to do
    before I can get to that level of speed.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!