Scott Dorsey <kludge@panix.com> wrote:
+---------------
| Well, that is traditional already. A lot of machines used to use the
| ascii (or local display code) value for A as the top byte for the add
| instruction, the code for S as subtract, and so forth. Of course,
| that was in the days when human beings would often have to read or
| write machine code, even if only to decipher coredumps.
+---------------
The venerable LGP-30 (circa 1959) was such a machine: four bits of the
Flexowriter character code for the instruction mnemonics *were* the
instruction codes. Bootstrap instructions were typed in with a console
switch set to read only four bits of each six-bit character, thus
one typed instructions (with hex addresses) directly into the machine,
without needing an assembler. IIRC, the 16 codes were as follows
["Z" = "Stop" isn't exactly mnemonic, but easy enough to remember]:
code char
0 Z Stop [conditional on console switches & track addr]
1 B Bring [load]
2 Y Yank(?) [store AC<addr_field> ==> mem<addr_field>]
3 R Return address store [nextPC + 1 ==> mem<addr_field>]
4 I Input [shift one 4-/6-bit char from KBD/tape into AC]
5 D Divide
6 N Multiply [saves lower half of result, usually an integer]
7 M Multiply [saves upper half of result, usually a fraction]
8 P Print [shift one char out of AC to typewriter/tape]
9 E Extract [logical-AND memory to AC]
f U Unconditional branch
g T Test and branch if AC negative
j H Hold [store AC, leaving AC unchanged]
k C Clear [store & clear accumulator (AC)]
q A Add [memory to AC]
w S Subtract
Note: The LGP-30 used hex digits, but *not* the ASCII-based hex we all
know today, 0123456789abcdef, since it used Flexowriter code, not ASCII.
Instead, it used 0123456789fgjkqw. (Really.)
Also, since the address field was not right-justified in the instruction,
addresses as typed appeared to be incremented by 4, e.g., the first few
locations in the machine were 0, 4, 8, j, 10, 14, 18, 1j [pronounced
"J-teen"], 20, 24, 28, 2j ["Twenty-J"], etc.
Note#2: The "R" instruction stores the address of the *second* following
instruction ("PC+1" or ".+2") into the target, since the subroutine calling
sequence took two instructions and *modified* the routine being called, e.g.:
...
r123j
u1230 -------> 1230: ... ; first instr of subr...
... <---\ 1234: ...
\ 1238: ...
\-- 123j: u0000 ; return (addr overwritten by "r123j")
-Rob
p.s. Other than the state on the drum (PC, IR, AC), there were
only 15 bits of state (15 flip-flops) in the entire LGP-30 CPU
[plus 6 inverters, 6 non-inverting buffers ("cathode followers"),
and a whole *mess* of passive diode logic (cascaded ANDs and ORs)].
The entire "this state/next state" Boolean equation for the machine
is given in less than six pages of the maintenance manual (typed,
with some symbols hand-drawn).
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607