5

What was the first publication to document what is (now) known as AT&T syntax assembly language?

1 Answers1

3

As sampablokuper (OP) has noted, the UNIX Programmer's Manual cites PAL-11R as the source of the syntax, with only minor changes. So I've found a published book from May 1971, the PAL-11R Assembler Programmer's Manual that describes the syntax. Given that the syntax was probably around in 1969, this is still almost definitely not the earliest.


The earliest I can find with a casual web search is the UNIX Programmers Manual of November 1971 (better version). If you scroll to page 195 (page 5), you'll see this:

173700: mov      $177472,r0                   12700;177472
        mov      $3,—(r0)                     12740;3
        mov      $140000,—(r0)                12740;140000
        mov      $54000,—(r0)                 12740;54000
        mov      $—2000,—(r0)                 12740;176000
        mov      $5,—(r0)                     12740;5
        tstb     (r0)                         105710
        bge      .—2                          2376
        jmp      *$5400Q                      137;54000

173740: mov $177350,r0 12700;177350 clr —(r0) 5040 mov r0,—(r0) 10040 mov $3,—(r0) 12740;3 tstb (r0) 105710 bge .—2 2376 tst *$177350 5737;177350 bne . 1377 movb $5,(r0) 112710;5 tstb (r0) 105710 bge .—2 2376 clr pc 5007

That, if I'm not mistaken, is AT&T syntax!


The earliest paper on UNIX, according to this source, is this paper. This document is from July 1974, so it's no good as a first, and does not include any AT&T syntax anyway. It does, however, state that the first version of UNIX was made circa. 1969–1970. This isn't necessarily a limit on the earliest that the syntax could've been described in a publication, since it might predate UNIX; I don't know.

wizzwizz4
  • 18,543
  • 10
  • 78
  • 144
  • Thanks! I had not previously seen mov used by itself in AT&T assembly code (always movb, movl, etc.), but that does not mean mov was (is?) not valid AT&T syntax. (I am new to the syntax.) I will upvote this and provisionally mark it as correct. If any other answers come along, with earlier examples, I will move the "correct" mark accordingly. –  Dec 30 '18 at 23:27
  • @sampablokuper Thanks. I see that no on-boarding is necessary, then! :-) This is the first I've heard of AT&T syntax (actually, that's a lie, but I've never really looked at it before) so I can't answer you that, unfortunately. – wizzwizz4 Dec 30 '18 at 23:28
  • 1
    On page 21 of the first PDF in your answer, the man page for as states, "as is based on the DEC-provided assembler PAL-11R, although it was coded locally. Therefore, only the differences will be recorded [in this man page]." The differences seem fairly minor. So, it seems that what we now call "AT&T syntax" is largely due to DEC rather than AT&T. Interesting. –  Dec 31 '18 at 00:23
  • Isn't it, as already mentioned, just a normal syntax for PDP-11? Isn't "at&t syntax" is the way to express i386 (and amd64) assembly with the source to the left and destination to the right? This convention is routinely used in PDP-11 assembly, VAX assembly and m68k assembly, but not in i386 one. – lvd Dec 31 '18 at 12:38
  • @lvd AT&T and Intel are the names for the two surviving Assembly syntaxes. – wizzwizz4 Dec 31 '18 at 12:45
  • 4
    DEC used #foo for an immediate operand in -11 assemblers; the Unix guys apparently preferred $foo, which to my eyes lacks any mnemonic significance. Similarly @ became *. Does anyone know the rationale or is this just personal taste? – dave Dec 31 '18 at 15:19
  • 2
    @another-dave Ask a new question and more people will see this to be able to answer it. – wizzwizz4 Dec 31 '18 at 15:47
  • 1
    @another-dave: # and @ were apparently hard to type (Unix Assembler Reference Manual §8.1 - Dennis M. Ritchie, referenced in my answer of https://stackoverflow.com/questions/4193827/questions-about-att-x86-syntax-design), fuz says "As the UNIX tty driver used @ and # as control characters, $ was substituted for # and * for @. at https://stackoverflow.com/questions/42244028/what-was-the-original-reason-for-the-design-of-att-assembly-syntax – ninjalj Jan 01 '19 at 13:06
  • @ninjalj - Aha! of course! I'd forgotten those characters had special meaning in Unix. – dave Jan 01 '19 at 13:17
  • @ninjalj If another-dave isn't going to post a question, you could write a question/self-answer pair and cash in on those juicy reputation points. – wizzwizz4 Jan 01 '19 at 13:36
  • I considered it answered so didn't see any need to post a question. Clearly I'm not entirely familiar with the local culture. I'm happy for ninjalj to claim credit. – dave Jan 01 '19 at 14:51
  • @another-dave The site's around, not for the people who ask to get answers to their questions, but for future readers to get answers to their questions. Often questions that won't benefit future readers are closed before people put effort into answering them, because they're really specific (though I don't think we've ever had one of those). – wizzwizz4 Jan 01 '19 at 17:29
  • @wizzwizz4 Note that Plan 9 syntax too survived through the Go project. – fuz May 04 '19 at 13:01