public domain as86

Skip to first unread message

Paul Edwards

Nov 6, 2022, 12:22:38 AM11/6/22

This has just been released:

along with a corresponding:

Previously the only public domain 8086 assembler
I had access to is the one that came with SubC.

This new assembler produces 16-bit a.out, which is a
format I am happy to standardize on.

What I'm more hazy about is the assembly language.

Basically what I'm looking for is the lowest common
denominator of the latest versions of DOS-supporting
masm, wasm, and as86.

Unfortunately multiple memory models interest me -
tiny, small, large and huge, so I can't easily just pick one.

It is unclear to me how much effort would be required to
change SubC to generate large memory model instead of
small memory model, which would eliminate my interest
in small.

Tiny I am interested in due to boot sector code, but since
that is hand-written anyway, it could probably be considered
large anyway.

Also during booting (of PDOS/86) I have an IO.SYS which is
tiny memory model, but since it will always be loaded at a
fixed address, I may be able to get ld86 to generate an
appropriate binary image and I can switch to large.

I don't use huge at the moment - that is a future plan - so that
can be deferred.

The author of as86, Robert, is willing to make enhancements,
but I don't want to ask for too much.

I'm happy to rewrite my assembler source - there's not that

I'm not interested in other dialects like nasm - in the long term
I am looking for 100% masm-compatibility, but in the short
term I'm willing to use conditional assembly as required.

Sophisticated things like "proc" which gives you variables
and saves registers, like this:

int86 proc uses ax bx cx dx si di ds es, \
intnum:word, regsin:ptr, regsout:ptr

are probably a bridge too far at the moment, so I will
define those manually, e.g. intnum [bp+6] for large
memory model.

Maybe he can easily add @DataSize - I assume there is
a corresponding @CodeSize - which may help.

I noticed one divergence from masm.

Masm doesn't like this:

db 'h'

And instead requires:
L2 db 'h'

(for the beginning of a hello world string generated by SubC)

as86 doesn't like the other way around.

Is there a way of coding acceptable to both?

Otherwise I need to see if I can get Robert to accept
both (as wasm does).

Any suggestions on where I stand?

In the short term I'm willing to accept hacks in order
to move onto the public domain tools.

Thanks. Paul.

Alexei A. Frounze

Nov 6, 2022, 1:24:15 AM11/6/22
On Saturday, November 5, 2022 at 9:22:38 PM UTC-7, Paul Edwards wrote:
> Masm doesn't like this:
> .data
> L2:
> db 'h'

If it helps, you could probably do:

L2 label byte
db 'h'


Paul Edwards

Nov 6, 2022, 1:52:44 AM11/6/22
On Sunday, November 6, 2022 at 1:24:15 PM UTC+8, Alexei A. Frounze wrote:

> If it helps, you could probably do:
> L2 label byte
> db 'h'


That should be relatively simple to at least hack to be the
equivalent of "L2:", so I'll ask for that.

BFN. Paul.

Pavel vitsoft Šrubař

Nov 9, 2022, 3:57:28 PM11/9/22
On Sunday, November 6, 2022 at 5:22:38 AM UTC+1, Paul Edwards wrote:
> tiny, small, large and huge, so I can't easily just pick one.

Perhaps you could look at EuroAssembler, it is free, supports PROC, STRUC, %MACRO etc. and of course it assembles both
db 'h'
L2 db 'h' .

Example of 16bit MZ program for DOS in large memory model:

Paul Edwards

Nov 9, 2022, 10:57:53 PM11/9/22
It took a while to find the copyright notice:

I already have a copyrighted assembler that is suitable for my
purposes - wasm, although I guess one thing that is missing
is that it isn't C90-compliant and even if it was, it hasn't been
recompiled so that it runs under PDOS/386.

If Euroassembler was C90-compliant already and could handle
my code, and was compiled into a Windows executable that
was only dependent on msvcrt.dll and could be shipped as
part of PDOS/386, I would have a use for it in the short term

But long term I'm trying to move to a public domain one, even
if it is bare bones. I'm happy for my assembler source to be
made neater as the PD assembler improves over time, like
over the next 500 years.

The PD one is being actively worked on now (like, minutes ago),
as I try to find out what is possible.

BFN. Paul.

Reply all
Reply to author
0 new messages