Early versions of Unix included Doug McIlroy's tool tmg ("transmogrifier"), an early compiler-compiler. TMG was implemented in Dennis Ritchie's assembly language as well as in TMGL itself (the language that TMG translates into assembly). Here is TMG's manual (1972). Here is the complete source code from Version 6 Unix.

Since I am trying to understand how McIlroy's implementation of TMG worked, I am reading the file tmgl.s, a translation of tmgl.t done by TMG. And I am baffled by the following excerpts:




I read the PAL-11R and Unix Assembly manuals, but do not recall an explanation.


  • . means "location counter", but what is .3=.?
  • .. means "relocation counter", but what is ..3?

(To make things worse, this kind of syntax seems to be only encountered in TMG implementation, not any other source file of Unix V6. And, to exclude the possibility of a corrupt code or phased out syntax, TMG sources actually compile in a Python PDP-11 emulator running Unix V6.)

  • 1
    Might be better suited for retrocomputing.stackexchange.com. I'd assume =. assigns the current location counter, and IIRC .1, .2 etc. are "local" labels (can be redefined). If the syntax makes a differences between "location" and "relocation" labels, I'd expect the same for ..1 etc. – dirkt Jul 2 '19 at 10:13
  • 1
    In the end of this research, I ported TMG from PDP-11 assembly to C. If anyone is interested: github.com/amakukha/tmg – Andriy Makukha Feb 1 '20 at 17:09

.1, ..1 have no special meaning. They're simple identifiers (labels, variables, etc). Unless declared with .globl, they will be local by default.

That was the case then and is still the case now. For instance, gcc is using . to prevent static variables from conflicting with symbols defined by the user.

what is .3=.?

It assigns to the local symbol named .3 the value of the location counter (the offset within the current segment).

  • Confirmed. I changed most of the prefix dots to zs, assembled, linked with the "squash" option and got exactly the same executable. Luckily, the answer is much simpler than I thought ^_^ – Andriy Makukha Jul 2 '19 at 18:26

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.