The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Robert Clausecker <fuz@fuz.su>
To: tuhs@tuhs.org
Subject: Re: [TUHS] Design of the AT&T assembly syntax
Date: Mon, 28 Oct 2019 23:24:17 +0100	[thread overview]
Message-ID: <20191028222417.GA45136@fuz.su> (raw)
In-Reply-To: <CANCZdfo-DnYM8_1mQZMcgKd7OP14iJ7ffF7PLJv-xMRBBTuaOw@mail.gmail.com>

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

  reply	other threads:[~2019-10-28 22:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 20:07 Robert Clausecker
2019-10-28 22:08 ` Warner Losh
2019-10-28 22:24   ` Robert Clausecker [this message]
2019-10-28 22:29     ` Warner Losh
2019-10-28 20:14 Robert Clausecker
2019-10-28 21:06 ` Seth Morabito
2019-10-29  0:31   ` Nemo Nusquam
2019-10-28 21:48 Alexander Voropay
2019-10-28 21:59 ` Robert Clausecker
2019-10-29 14:38 Alexander Voropay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191028222417.GA45136@fuz.su \
    --to=fuz@fuz.su \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).