[TUHS] Design of the AT&T assembly syntax

Robert Clausecker fuz at fuz.su
Tue Oct 29 08:24:17 AEST 2019


Hi Warner,

On Mon, Oct 28, 2019 at 04:08:53PM -0600, Warner Losh wrote:
> VENIX 2.0 had this. It was a Pure AT&T syntax w/o % signs:
> 
> eg
> |
> | VENIX/86 start off (bootstrap starts execution at location 0 `start').
> |
> | Relocate complete kernel down to low memory.
>         .text
> start:  cli
>         mov     dx,#LOWMEM      | base of relocated kernel
>         mov     cx,cs
>         cmp     cx,dx           | are we there (put there by bootstrap) ?
>         beq     L0002           | Yes.
>         mov     ds,cx
> 
> which is clearly op dst, src.

op dst, src is Intel syntax.  AT&T syntax has op src, dst like MACRO-11.
There are a number of other differences: (a) | instead of / or # as a comment
character (b) different mnemonics (beq instead of je) and (c) # instead of $
as the comment character.

Without seeing some more code, I'd say it's not AT&T syntax.

> VENIX's compiler was from the MIT compiler collection which was a port of
> the portable C compiler to x86 that everybody used (it seems, I don't have
> a reference for that, just speculation).  You can find a version of
> this code in the TUHS archive in Applications/Portable_CC which has the
> 8086.zip.
>
> There's follow on work from a university in Queens in 286.zip that adds
> near/far stuff (the original one didn't, and the VENIX code assumes none of
> the segment registers change in userland code for its context switching
> code). I've not looked at this code.

Will have a look!

> All this code is dyed in the wool K&R code from a V7-level C compiler, so
> it won't compile on newer systems. And it's a right-royal pain in the
> backside to convert on the fly because it wasn't written to be portable to
> ANSI compilers and modern C compilers no longer have a K&R mode...
> 
> Thanks again to Al Kossow for this being in the archive. It's possible to
> find this on FTP sites if you look hard enough. I found them in the past,
> but I can't find it now that I went looking, so I'm quite happy that it's
> in the archive. VENIX 2.1 released a newer version of the compiler than was
> in VENIX 2.0. I don't know if those pre-date or post-date this stuff.

Thank you for trying to dig up the source.

> Sadly, the modern PCC project no longer works with 16-bit code, but I
> suppose that's par for the course these days.

OpenWatcom still works, but it's not too compatible.

> Warner
> 
> Yours,
> > Robert Clausecker
> >
> > [1]: https://stackoverflow.com/a/42250270/417501

Yours,
Robert Clausecker

-- 
()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments


More information about the TUHS mailing list