The TECO editor, (originally Tape Editor and COrrector, later Text Editor...) found in some form on just about every computer and operating system DEC ever made, provides variables in which you can store numbers and/or text.

These variables are called "Q-registers".

Anyone know why that name was used? Is this related to anything on PDP-1 (which had the original TECO implementation)?

  • Upvoted, my deleted answer made no sense. However, I found this: books.google.nl/… and it seems A, Q and M registers are typically used for ALU (Arithmetic Logic Unit) description; and high likely it's related. But it doesn't show obviously why it is called Q. See page 290. – Michel Keijzers Aug 17 '19 at 15:11
  • 1
    Possibly because you need an intellect equal to Q's in order to use TECO properly. :-P – ErikF Aug 17 '19 at 17:58
  • 1
    Already in early TECO, the letter q ("quantity") was used to retrieve the value of a register. That might have been the reason to call them Q-registers, but that's a conjecture. Trying to trace reasons for why things are named a certain way is difficult; they way this usually goes is that someone comes up with a name, and the name then sticks. – dirkt Aug 17 '19 at 20:26
  • 1
    Oh, I see. The q-regs were named after the command to read the value in one, not the other way around. Plausible enough... – another-dave Aug 18 '19 at 0:11
  • 1
    @MichelKeijzers - if by "why it is called Q" you meant the Q register in a standard ALU arrangement, it's the Quotient register. Sometime combined with the Multiplier register to be the MQ register. – another-dave Aug 20 '19 at 0:20

It's really more of a conjecture, but if it is considered suitable as an answer:

Already in early TECO, the letter q ("quantity") was used to retrieve the value of a register. That might have been the reason to call them Q-registers.

Trying to trace reasons for why things are named a certain way is always difficult; they way this usually goes is that someone comes up with a name, other people start using it, and the name then sticks. This process doesn't leave a lot of written records, and even if you ask people involved, they are probably not aware of how this happened.

| improve this answer | |
  • 1
    This has the smell of plausibility to me -- the command was 'q', possibly because of 'quantity' or possibly because this was one of the few available letters! -- and the registers were named after the command. I'd been looking at it the other way round. Unless Dan Murphy drops by, we likely won't know for sure. Maybe I asked an unknowable question. – another-dave Aug 20 '19 at 2:23
  • 5
    Supporting your answer. I was a developer of TECO at the MIT AI Lab. I added a set of command-line macro features which were under the <cntl>-] key. As you might suspect, they were referred to as the "control close bracket" commands. I also added LOTS of extra Q-registers by prefixing the name with one or more periods. These were the "dot", "dotdot", and "three-dot" Q registers. I should look in an old listing and see if there are any comments about the "Q" name. – cmm Aug 22 '19 at 3:02

TLDR: TECO uses single-character commands. When extending TECO to add registers to store numeric values, there was a limited set of unused characters left for the commands associated with this functionality. q was chosen as one of these command characters because it could serve as a mnemonic for "quantity." This led to the numeric registers being called "Q-registers" and, though an unfortunate misunderstanding, eventually this was applied to the completely separate set (albeit sharing the same names) of text-valued registers as well.

dirkt's answer gives us the paper describing the timeline of how registers storing text and numeric values came about: "The Beginnings of TECO" by the original author of TECO, Dan Murphy.

On page 113 (PDF page 4), in the section "TECO becomes a programming language," Murphy describes the appearance of storage registers:

By late 1962, TECO had about the level of capabilities that simple editors would have for years to come, but TECO’s development didn’t stop there....

I added the concept of text variables—that is, a variable that would hold an arbitrary section of text. The command to move a range of text into a text variable was x. (I was running low on unused letters by then.) [emph. added] ...g (get) was used to copy the contents of a text variable into the main buffer at the editing point.... Despite the lack of a mnemonic association for x, it quickly came to seem natural, almost intuitive. To x something became as easily spoken and understood by TECO users as "store" would have been.

He goes on to discuss a separate set of registers for numeric values, sharing the same names:

Integer variables were also added around this time, again from the single-letter set a–z, 0–9. u (use) would store its argument into the variable, and q (quantity) would stand as the stored value in an expression. The same variable name could have both a text and numeric value; the command determined which was being referenced.

"Q-register" was a natural name for the registers retrieved by the q command. The name "Q-register" had been codified by 1965: Peter Samson, in AIM-81 "PDP-6 TECO" (July 1965) writes (p.2):

There are three kinds of storage areas within TECO: (1) the buffer; (2) the 36 Q-registers; designated 1,...9, A,B,...Z; (3) the command string area....

Each Q-register may: (a) be undefined; (b) contain a positive or negative integer; (c) contain a character string.

...the Q-registers are locations for remembering quantities, or strings of text, for later use;...

Unfortunately, Samson is clearly confused here about the nature of the registers, stating that there are only 36 registers holding either an integer or textual value, whereas there are actually 72 registers, 36 holding integers and another 36—sharing the same names—holding textual values. Thus he unfortunately applies the term "Q-register" not only to the registers retrieved with q but also the other set retrieved with g.

Despite changes in terminology, no version of TECO I'm aware of has ever combined the two register sets into one, but always maintained numeric and textual values as separate registers. The Standard TECO User's Guide and Language Reference Manual (May, 1985, describing TECO-11 version 40, TECO-10 version 3 and TECO-8 version 7) correctly describes the split, though using Samson's terminology of "Q-register" to refer to both the text and integer registers and instead giving each "register" the ability to store two values:

3.3.2 Q-registers

TECO provides data storage registers, called Q-registers, which may be used to store single integers and/or ASCII character strings. Each Q-register is divided into two storage areas. In its numeric storage area, each Q-register can store one signed integer. In its text storage area, each Q-register can store an ASCII character string (which can be any text, including the important case of a TECO command string).

So, to summarize, the numeric registers were reasonably referred to as "Q-registers" because they were retrieved with the q command, and a misunderstanding about the nature of the registers caused a separate set of registers retrieved by the g command also to be referred to as "Q-registers." This misunderstanding was probably due to both sets of registers sharing the same (single-character) names.

| improve this answer | |

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.