The closest I was able to find on StackOverflow is What are .S files?, in which no answerer addresses why we use .s for assembly. (And .S for preprocessor/macro assembly; and gcc -S to produce assembly...)

(By "we," I mean basically the POSIX ecosystem. I understand that the .s convention isn't universal. But the convention that does exist, must have originated somewhere.)

My wild guesses are:

  • .s for "source," as opposed to .o for "object." Seems to require a timeline where we had 8.3 filesystems before we had high-level languages.

  • .s for aSsembler, because .a was already occupied by Archive.

Anyone got an authoritative answer, or any anecdotal citations to establish a "not after" date?

  • 2
    Regarding “not after”, PDP-7 Unix used .s extensions in 1969. – Stephen Kitt Oct 24 '20 at 19:58
  • 3
    Although that might be post-facto, since the source files were reconstructed from print-outs. V1 Unix definitely used .s extensions, they’re mentioned e.g. in the B manpage. – Stephen Kitt Oct 24 '20 at 20:44
  • Though not on the as manpage - so more like a compiler intermediate-file convention rather than an assembler-source convention. – another-dave Oct 24 '20 at 21:46
  • 1
    I guess Unix. DEC systems of the 1960s and later were in the habit of using mutticharacter (generally 3, but 2 on 12-bit systems) extensions. Unix tended to brevity in all things. – another-dave Oct 24 '20 at 21:50
  • IDK, but Unix loved terse names; "ld," "rm," "mv." Single-letter filename extensions are very much in that spirit, and there aren't all that many single letters from which to choose. – Solomon Slow Oct 27 '20 at 12:50

The V1 Unix B manpage uses .s as the extension for intermediate assembly files used during the build. This is the earliest use of .s that I can find, and would correspond to November 1971 at the latest.

There were assemblers on systems with file systems before Unix, but none that I’m aware of used .s. Some like DECsys don’t appear to have extensions; other used extensions referring to the tool used to process files (e.g. .fap).

Unix as was based on PAL-11R, which used the PAL extension (see page 9-2 of the PAL-11R manual, thanks another-dave!).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.