3.4. AS86

AS86 is a 80x86 assembler, both 16-bit and 32-bit, with integrated macro support. It has mostly Intel-syntax, though it differs slightly as for addressing modes.

3.4.1. Where to get AS86

Current version is 0.15.4, it can be found at http://www.cix.co.uk/~mayday/, in bin86 package with linker (ld86), or as separate archive.

Note: A completely outdated version 0.4 of AS86 is distributed by HJLu just to compile the Linux kernel versions prior to 2.4, in a package named bin86, available in any Linux GCC repository. But I advise no one to use it for anything else but compiling Linux. This version supports only a hacked minix object file format, which is not supported by the GNU binutils or anything, and it has a few bugs in 32-bit mode, so you really should better keep it only for compiling Linux.

3.4.2. Where to find docs

See the man page and as.doc from the source package. When in doubt, the sources themselves are often a good docs: they aren't very well commented, but the programming style is straightforward. You might try to see how as86 is used in ELKS, LILO, or Tunes

3.4.3. Using AS86 with BCC

Here's the GNU Makefile entry for using BCC to transform .s asm into both a.out .o object and .l listing:

%.o %.l:	%.s
	bcc -3 -G -c -A-d -A-l -A$*.l -o $*.o $<

Remove the %.l, -A-l, and -A$*.l, if you don't want any listing. If you want something else than a.out, you can examine BCC docs about the other supported formats, and/or use the objcopy utility from the GNU binutils package.