PRELIMINARY

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00 SR
00 00
SR
00 01
SR
00 02
SR
00 03
SR
00 04
SR
00 05
SR
00 06
SR
00 07
SR
00 08
SR
00 09
SR
00 10
SR
00 11
SR
00 12
SR
00 13
SR
00 14
SR
00 15
01 SR
01 00
SR
01 01
SR
01 02
SR
01 03
SR
01 04
SR
01 05
SR
01 06
SR
01 07
SR
01 08
SR
01 09
SR
01 10
SR
01 11
SR
01 12
SR
01 13
SR
01 14
SR
01 15
02 SR
02 00
SR
02 01
SR
02 02
SR
02 03
SR
02 04
SR
02 05
SR
02 06
SR
02 07
SR
02 08
SR
02 09
SR
02 10
SR
02 11
SR
02 12
SR
02 13
SR
02 14
SR
02 15
03 SR
03 00
SR
03 01
SR
03 02
SR
03 03
SR
03 04
SR
03 05
SR
03 06
SR
03 07
SR
03 08
SR
03 09
SR
03 10
SR
03 11
SR
03 12
SR
03 13
SR
03 14
SR
03 15
04 + DIRECT* – DIRECT* × DIRECT* ÷ DIRECT* STORE DIRECT* RECALL DIRECT*


DIRECT*
SEARCH* MARK* GROUP 1* GROUP 2* WRITE* WRITE ALPHA* END ALPHA STORE Y* RECALL Y*
05 + INDIR – INDIR × INDIR ÷ INDIR STORE INDIR RECALL INDIR


INDIR
SKIP if Y≥X SKIP if Y<X SKIP if Y=X SKIP if ERROR RETURN END PROG LOAD PROG GO STOP
06 + × ÷ ↑↓ |X| INTEGER X π Log10X LogeX √X 10x ex 1/x
07 0 1 2 3 4 5 6 7 8 9 SET EXP CHANGE SIGN . x2 RECALL RESIDUE CLEAR X
08 (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O) (I/O)
09 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
10 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
11 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
12 + DIRECT (+100)* – DIRECT (+100)* × DIRECT (+100)* ÷ DIRECT (+100)* STORE DIRECT (+100)* RECALL DIRECT (+100)*


DIRECT (+100)*
? ? ? ? ? ? ? STORE Y (+100)* RECALL Y (+100)*
13 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
14 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
15 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

DIRECT prefixes (incl. STORE/RECALL Y)
The second step is a register number, aa bb, where bb = 10..15 overlaps with aa+1 00..05 (i.e. normal range for bb is 00..09). Use of the "DIRECT + 100" commands is usually required to access registers above 09 09, although codes such as 11 09 (register 119) may also be used. Any code may be used, however END PROG (05 12) should be avoided.

SEARCH and MARK prefixes
The second step is a "label", used to implement goto and call. Any code may be used, however END PROG should be avoided.

WRITE ALPHA prefix
Code(s)Key(s)Function
00 00
through
03 15
(various) Print character to OutputWriter.
08 00
through
11 15
(various) Plot character 00 00 through 03 15 to a Plotting OutputWriter or flatbed plotter. Plotting is only available on "B" and "C" models.
07 00
through
07 09
0 through 9 Multiply X by 10xx (00 = 10)
06 00
through
06 09
(various) (duplicate) X ×= 10xx
05 00
through
05 09
(various) (duplicate) X ÷= 10xx
04 00
through
04 09
(various) Divide X by 10xx (00 = 10)
04 10 GROUP 2 SKIP if Y positive
04 11 WRITE SKIP if Y = 0
04 12 WRITE ALPHA (cancel WRITE ALPHA?)
04 13 END ALPHA end WRITE ALPHA
04 14 (store Y direct) (duplicate) 180/π
04 15 (recall Y direct) (duplicate) π/180
05 10 SKIP IF ERROR SKIP if Y negative
05 11 RETURN SKIP if Y ≠ 0
05 12 END PROG
SIGN(X) = "saved sign"
05 13 LOAD PROG
X = "quadrant" ¤
05 14 GO 180/π
05 15 STOP π/180
06 10 LOG10X SKIP if X positive
06 11 LOGeX SKIP if X = 0
06 12 √X
quad = X ¤
"saved sign" = (quad == 1,2)
Y = |Y|
X = 1
if (quad == 1,3) Y = Y - 1
06 13 10X
if ("other state 10" == "other state 13") then
    if ("other state 10" != 0) then
        X = 90 ¤
        Y = -Y
    endif
    Y = Y + X
endif
06 14 eX
"quadrant" = QUADRANT(X,Y)

1
X- Y+
0
X+ Y+
2
X- Y-
3
X+ Y-

06 15 1/X Pause
07 10 SET EXP SKIP if X negative
07 11 CHANGE SIGN SKIP if X ≠ 0
07 12 . (decimal point)
quad = X ¤
"saved sign" = (quad == 1,2)
Y = |Y|
X = 1
if (quad == 1,3) ENTER(1)
[just an uninteresting fall-through decoding?]
07 13 X2
invert "other state 10"
07 14 RECALL RESIDUE (duplicate?) compute quadrant
07 15 CLEAR X
"saved sign" = SIGN(X)
X = |X|
Y = |Y|
if (X >= 1) then
    invert "other state 13"
    X = 1/X
endif

¤ The most-significant digit of the X mantissa is accessed directly (exponent and mantissa are not considered). The X register must have compatible contents prior to executing these codes. For example, prior to WRITE ALPHA 10X the X register must have a two-digit integer (i.e. some whole number 10..99). Other codes typically require a single-digit number (1..9).

WRITE prefix
00 00 through 09 15 Print display, formatted, to OutputWriter (device 1). First number is number of (blank-filled) integer places, second is number of decimal places. 00 xx is for scientific notation, also xx 11 through xx 15.
12 xx Print field of xx blanks to OutputWriter.

GROUP 1 prefix
Send next code to "device 4". In program, issues XS=0, then XS=6 with data, then program stops (device issues GO to continue). From keyboard, issues XS=4 instead of 6.

GROUP 2 prefix
Send next code to "device 5". In program, issues XS=0, then XS=7 with data, then program stops (device issues GO to continue). From keyboard, issues XS=5 instead of 7.

08 00 through 08 15 (I/O) - Random-Access Device I/O
I/O codes are only functional on "C" models
Perform block read/write between device address in Y and program memory step in X. User must compute equivalent program step number from register number when transferring register data.
08 00 through 08 07 page-in blocks of program steps from "device 2". "Source" address is in Y (integer portion, 0 - 16M). In X is the starting program step number (integer portion, 0000 - 1983). Length determined by 'xx':
00010203 04050607
1 step 8 steps 16 steps 32 steps 64 steps 128 steps 256 steps (nothing)
08 08 through 08 15 page-out blocks of program steps to "device 2". "Destination" address is in Y (integer portion, 0 - 16M). In X is the starting program step number (integer portion, 0000 - 1983). Length determined 'xx':
08091011 12131415
1 step 8 steps 16 steps 32 steps 64 steps 128 steps 256 steps (nothing)

OutputWriter (IBM Selectric) Character Codes
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00 - y space back space q p = j tab / set tab clr tab , ; f g
01 w s shift dn shift up i ' . ½ return index o index rev index a r v m
02 b h step x+ step x- k e n t print mode l step y+ step y- c d u x
03 9 0 step x+y+ step x-y+ 6 5 2 z plot mode 4 step x+y- step x-y- 8 7 3 1
S
H
I
F
T
E
D
_ Y space back space Q P + J tab ? set tab clr tab , : F G
W S shift dn shift up I " . ¼ return index O index rev index A R V M
B H step x+ step x- K E N T print mode L step y+ step y- C D U X
( ) step x+y+ step x-y+ ¢ % @ Z plot mode $ step x+y- step x-y- * & # !

Flatbed Plotter Character Codes
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00 - Y space / Q P + J } ? = { , : F G
01 W S pen dn pen up I ' . n/a return index? O index? rev index? A R V M
02 B H step x+ step x- K E N T print mode 1 step y+ step y- C D U X
03 9 0 step x+y+ step x-y+ 6 5 2 Z plot mode 4 step x+y- step x-y- 8 7 3 L
04 - Y space / Q P + J } ? = { , : F G
05 W S plot move I ' . n/a chr size O chr space home A R V M
06 B H step x+ step x- K E N T print mode 1 step y+ step y- C D U X
07 9 0 step x+y+ step x-y+ 6 5 2 Z plot mode 4 step x+y- step x-y- 8 7 3 L

Teletype Character Codes
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00 - Y space n/a Q P = J n/a / DC2 DC4 , ; F G
01 W S shift dn shift up I ' . ! CR/LF O LF n/a A R V M
02 B H n/a n/a K E N T n/a 1 n/a n/a C D U X
03 9 0 n/a n/a 6 5 2 Z n/a 4 n/a n/a 8 7 3 L
S
H
I
F
T
E
D
n/a Y space n/a Q P + J n/a ? DC2 DC4 , : F G
W S shift dn shift up I " . n/a CR/LF O LF n/a A R V M
B H n/a n/a K E N T n/a 1 n/a n/a C D U X
( ) n/a n/a n/a % @ Z n/a $ n/a n/a * & # L

The codes highlighted red are generated by the calculator and have unknown results if embedded in an ALPHA command. The calculator indicates the X and Y delta (the X and Y display registers, respectively) by issuing an appropriate number of the step codes, and the output device effectively counts them and performs the plotting motion.

The codes highlighted green are deviations from the OutputWriter, but only affect the ways strings are created by the programmer. The calculator microcode does not generate these. Note, however, that the IBM Selectic "Shift Up" and "Shift Down" codes have conflicting meanings with the Flatbed Plotter. Software written for the OutputWriter will probably not work without modification on the Flatbed Plotter. However, the modifications are probably limited to the ALPHA - ALPHA END sequences. Note, some commands require X and Y delta values that are used as parameters, not carriage movement.

The codes highlighted blue are plotted characters, the X and Y delta values are used to move the pen to the desired position where the indicated character is drawn. Note, only the first character of a string should be marked as plotted, or else each character will be speparated from the last by the X and Y delta. Plotting is only available on "B" and "C" models.

The codes highlighted gray indicate deviation from the normal shifted mode of the character but are otherwise still aligned with the Selectric codes.

The codes highlighted yellow are unknown/undefined.

Note, the interface to the device only supports 6 bits. The above tables indicate what a programmer would put in an ALPHA - ALPHA END sequence to produce the indicated results. The device interprets the codes 0x00 through 0x3f according to state previously set up (e.g. plot mode or print mode).

Note the reversal of "1" and "L" in the Plotter/Teletype tables. The IBM Selectric considered the digit 1 to be redundant with lower-case ell. Many typeballs replaced "1" with other special characters. Because of this, the Wang microcode could not assume that it could print a "1" using the code for "1". Therefor, it uses lower case ell. In order to use the same microcode for both the Output Writer and the Plotter, the plotter's character decoding had to interpret lower case ell as "1" and use the encoding normally assigned to "1" as "L". This means that programs written for the Output Writer may not be completely compatable with the Plotter/Teletype.

"DC2" and "DC4" are ASCII control characters that cause the Teletype paper tape punch to turn on and off, respectively.