On WASM, and other assemblers ...
April 17, 2006
I paid $10 for the registered version of WASM - the Wolfware Assembler - over ten years ago: a bargain-basement price for what was an excellent assembler. In it, Erick Tauck ignored Borland's and Microsoft's insistence that models be declared, that files be LINKed, and the "ptr", "assume", and various other unnecessary complexities one shouldn't be bothered with: assembler's hard enough without them. Even better, WASM version 2.23 is now available for free, courtesy of DOSOnly.Net.
The official spiel: "Wolfware Assembler (WASM) is a free assembler for the 8086 and compatible microprocessors. WASM is best suited for writing system utilities, TSR's, and other small programs. The minimum system requirements are an IBM pC or compatible, 100K of free memory, and DOS 2.0 or up. The assembler package consists of the assembler program, the user's manual, a list of version changes, and sample programs. All of the documentation (*.TXT) files are standard text files that can be displayed on the screen or printed. Unmodified copies of WASM may be shared and distributed. WASM may be used without obligation to the author."
On the downside, WASM doesn't handle commands specific to the 386-or-higher. I don't know if that's changed, and don't care: good DOS programs can be produced using 8088 code alone - DOS versions of NeoBook and Neopaint, both by NeoSoft, are two very capable software programs that come to mind. NeoBook EXE files can be megabytes in size and run on an XT! With that in mind, I made it a point of pride that my DOS programs all run on the slowest IBM PC or compatible.
Freeware examples of programs encoded with WASM include my DOS programming utilities BIOS Reporter and ScanCode Show (both available with full source code), and the keypress-DOS TSR KeyCount.
If, however, you're shopping for a more complex assembler, one that'll do 386+ code, protected mode, Windows, MMX, SIMD and AMD's 3DNow instructions, consider Eric Isaacson's A86. More pricey, manual more voluminous, tightest and cleanest code, and this man also disdains the hoops Borland and Microsoft would have you jump through. IMHO the best DOS assembler around, and I say that even though my loyalties lie with WASM...
The most interesting and versatile, is NASM, the Netwide Assembler - an open-source (i.e, free) 80x86 assembler designed for portability and modularity. It supports DOS, Linux and NetBSD/FreeBSD, a.out, ELF, COFF, Microsoft 16-bit OBJ and Win32, MMX, 3DNow!, SSE and SSE2 instructions, and has macro capability. For an assembler, it's relatively simple. It is continually being improved - currently undergoing intensive development - so be advised that it is a work in progress. Still, if I were actively programming assembler at present, it is the one I'd choose.
If I find the time, I'll probably post a few small example programs in this space, created with NASM, and with source code. Don't hold your breath.
As to the rest: Intel's MASM is often cryptic, convoluted, bloated, internally self-contradictory, and strange, and runs only under DOS. Borland's Turbo Assembler TASM isn't as bad, but MASM compatibility makes for many of the same problems, and it's pricey. gas is free, but horrible. as86 is Minix- and Linux-specific, and poorly-documented. Programmer beware.