• Please review our updated Terms and Rules here

Decent assembler/linker for 16 bit DOS?

hjalfi

Experienced Member
Joined
Feb 11, 2017
Messages
265
Location
Zürich, Switzerland
I'm looking for a reasonable assembler and linker for 16-bit DOS which will generate small mode exes. I need to something which I can legally distribute --- it's for my Cowgol compiler; currently it'll cross-compile to DOS but I want it to run natively (see http://cowlark.com/cowgol/).

So far the best options I've found are the Arrowsoft Assembler, which is public domain but for which no source is provided, and the VAL linker, which is also public domain and while it has source code it's uncompilable. But there's a vast amount of ancient and obscure software out there. Does anyone know of anything else? In particular, I'm only assembling a single source file, so if there's an assembler which will emit EXEs directly, that'll save me a lot of grief.

Thanks!
 
Interesting 'little' project you have got there. I will have a read some more when I get a bit of time over Christmas.

I would have thought that the old Intel Tools (e.g. AMS86, LINK86, LOC86) no one would care about any more...

Dave
 
It looks like a good candidate, but unfortunately I can't use it --- I've got some GPL stuff and the Open Watcom license is incompatible; I can't distribute both in the same package without violating the terms of at least one license!
 
What features would you need in this assembler? My compiler is GPL and can handle a source file that was nothing but assembly, but it doesn't do macros, includes, or defines (except for numeric constants). The default build also needs a lot of conventional memory for the sake of being able to compile itself, but this can be changed.

BTW, I heard the 'Arrowsoft' assembler was really a hacked MASM 4.x in disguise??
 
I know that NASM was able to run in DOS, but it may have required a 386 to run itself. This is definitely true for FASM. Both can create 16-bit applications, though.

What about using the Borland tools (Turbo C, Turbo C++) which were released into the public domain a few years ago? They should contain decent assembly support for starters.

Would https://github.com/microsoft/MS-DOS/blob/master/v1.25/source/ASM.ASM be an option? It's published in source by Microsoft on Github...
 
See if FASM meets your license requirements. The assembler itself is a 32-bit executable, so as mentioned above it needs a 386 (and CWSDPMI), but it can generate 16-bit DOS code simply and easily without a linker using the "format MZ" and "use16" directives.

The downside is that there's no simple directive to set the target CPU, so "use16" means 80286 instructions, unless you hack up a convoluted include file to avoid them.
 
Text, data, bss segments, with the ability to switch segments at will
Hmmm, well I have text, data, and bss segments but only one each, without switching. So that could be a disqualifier.
I know that NASM was able to run in DOS, but it may have required a 386 to run itself.
Oh, that's right. I think old versions like .97 were all 16-bit code in the DOS executable.
 
Turbo Assembler would be ideal, but unfortunately the distribution terms I've found don't look like it's distributable:

These historical files are provided to the Borland community free of charge. They may be downloaded and used "as is" for personal use only. No developer support is provided. Each individual product contains copyright notices that are still in force. These files may not be made available via the Internet or any hard copy media (e.g. diskette, CDROM).

FASM won't run on an XT class machine, sadly.

I have just found that DeSmet C is GPL'd, and its assembler is written in C and will run on an XT machine, but I don't know yet whether it'll emit OBJ files. Will need more investigation.

BTW, during my investigations I found the VAL open-source 16-bit linker. It's... different. Here's a clip of C source from it:

Code:
void end_linker(bit_16 return_code)
BeginDeclarations
EndDeclarations
BeginCode
 If statistics.val IsTrue
  Then
   linker_statistics();
  EndIf;
 exit(return_code);
EndCode

Yikes!
 
I use JWASM, and on my 80286 JWASMR. The nice thing about JWASM is that it supports native MASM 6 syntax and multiple output object formats, which makes it compatible with WLINK, JWLINK, TLINK and MS LINK.
It can also produce listing files and symbolic debug information.

TASM is also hyper nice because it pairs with turbo debugger, which is imo one of the best debuggers ever made.
 
Then you use it anyway, and tell the users of your product that Turbo Assembler is required, and then you provide off-site links to Turbo Assembler.

That's not his covenant. His goal is a full "free as in freedom" software chain for his works. Links to non-free software doesn't fit.
 
Then he's going to need a few more months to write an assembler and linker from scratch, as there is no software from that time period for that hardware that meets his licensing needs.
 
Back
Top