Discussion:
as86
(too old to reply)
muta...@gmail.com
2022-11-16 09:06:00 UTC
Permalink
There is a fantastic new development - a public domain
8086 assembler written in C90:

https://github.com/robertapengelly/as86

And there is a matching ld86 at the same place.

I've been working with the author, Robert, on getting
it to handle my hand-written assembler.

It uses a.out format, which has a 16-bit flavor.

Because of that, I can't really make use of it yet
until I have SubC able to handle my code base,
but I am preparing for that time, and have been
revamping my handwritten assembler.

However, I came across this unusual assembler,
the use of "seg", and have provided a dummy
program below.

It occurs to me that the a.out format may not be able
to handle the concept of only getting the segment
part of an address, and that I should instead rewrite
my code to reference it as an external address, so
that the concept exists of a simple address reference.

Anyone know?

Thanks. Paul.



C:\devel\pdos\src>wasm test.asm
Open Watcom Assembler Version 1.6
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
test.asm: 15 lines, 0 warnings, 0 errors

C:\devel\pdos\src>wlink file test.obj form dos
Open Watcom Linker Version 1.6
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
loading object files
creating a DOS executable

C:\devel\pdos\src>type test.asm
.model large

.stack 1000h

.code

top:

mov cx, seg dummy

dummy:

ret

end top
muta...@gmail.com
2022-11-16 09:10:56 UTC
Permalink
Actually, maybe the concept of different pointer sizes
doesn't exist in a.out, so I can't use compact and
medium memory models either.

That's fine if that's the case.

BFN. Paul.
muta...@gmail.com
2022-11-16 09:17:36 UTC
Permalink
I was wondering if large would be ruled out too,
because of the inability to distinguish between
stack and data.

But stack references don't need support in the
object file format so shouldn't be an issue.

Note that I am only now beginning to explore some
of these issues. I have spent most of my life
deliberately avoiding anything that wasn't C90, so
that any solution worked on the all platforms
including the mainframe.

BFN. Paul.
muta...@gmail.com
2022-11-16 15:19:16 UTC
Permalink
I think SubC has a restriction on pointer sizes being
the same size as ints.

I'm thinking of having SubC target large/huge memory
model plus 32-bit ints using dx:ax etc pairs. I think
SubC retrieves things from the stack for every operation
anyway.

I don't particularly care that it is going to be slow.

I do care about the increased amount of memory that
it is going to take, and I think I'm going to have to
switch to Turbo 186/80286 to give me the required
room.

I still wish to be restricted to 8086 instructions and
registers though.

Then at least apps written for PDOS/86 that aren't so
ridiculous can be run under real MSDOS.

BFN. Paul.

Loading...