Image Map Image Map
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Decent assembler/linker for 16 bit DOS?

  1. #1
    Join Date
    Feb 2017
    Location
    Zürich, Switzerland
    Posts
    206

    Default Decent assembler/linker for 16 bit DOS?

    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!

  2. #2

    Default

    You can try with JWASM: https://www.japheth.de/JWasm.html
    It can output EXE files without a linker, and the real-mode executable should work on any x86 CPU

  3. #3
    Join Date
    Jun 2012
    Location
    UK - Worcester
    Posts
    4,289

    Default

    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

  4. #4
    Join Date
    Feb 2017
    Location
    Zürich, Switzerland
    Posts
    206

    Default

    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!

  5. #5

    Default

    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??

  6. #6
    Join Date
    Feb 2017
    Location
    Zürich, Switzerland
    Posts
    206

    Default

    Quote Originally Posted by bakemono View Post
    What features would you need in this assembler?
    Text, data, bss segments, with the ability to switch segments at will, and that's it, really. 8086 code compatibility. Nothing exotic. Input is a single source file.

    Quote Originally Posted by bakemono View Post
    BTW, I heard the 'Arrowsoft' assembler was really a hacked MASM 4.x in disguise??
    Yikes! Yes! https://sourceforge.net/p/freedos/ma...sage/36429066/

  7. #7

    Default

    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/...source/ASM.ASM be an option? It's published in source by Microsoft on Github...

  8. #8

    Default

    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.
    int10h.org :: :: :: blog

  9. #9

    Default

    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.

  10. #10
    Join Date
    Feb 2017
    Location
    Zürich, Switzerland
    Posts
    206

    Default

    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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •