AUTUMN 2026 // WEEK 08

The Last Instruction

A recovered mainframe trace has lost its instruction names. Recover the machine’s output from its calibration traces and program.

Closes

Bench trace // four erased mnemonics

ENCOM / ARCHIVED BENCH TRACE
User: FLYNN
Review queue: Master Control Program.

Stacks are written bottom -> top.
PUSH n appends decimal n.
The four other instructions are DUP, ADD,
XOR and OUT, each assigned once to K/M/R/T.
DUP copies the top. ADD and XOR pop two
values and push their sum or bitwise XOR.
OUT pops one value as an ASCII character.

Calibration (each starts independently):
[6]    K -> [6,6]   output: none
[6,3]  M -> [9]     output: none
[6,3]  R -> [5]     output: none
[65]   T -> []      output: A

PROGRAM (start with an empty stack):
PUSH 41
K
M
PUSH 1
M
T
PUSH 85
PUSH 5
R
T
PUSH 32
K
M
PUSH 1
M
T
PUSH 80
PUSH 2
M
T
PUSH 64
PUSH 11
R
T