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
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
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
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
quickly came to seem natural, almost intuitive. To
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
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
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:
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.