Solution (source code)

= Solution

A <zero-address instruction> has no explicit operand addresses, so its operands and result location must be implicit in the <instruction set architecture>. A <stack machine> supplies these naturally: operations remove their inputs from the top of an operand <stack> and push the result. A fixed-<processor register> design is logically possible, so “almost certainly” is appropriately weaker than a proof that only a <stack machine> could work.

Write the <stack> from bottom to top, with its top on the right. Let $S$ stand for any unchanged prefix. Suitable effects are
$$
\boxed{\mathrm{add}:S,u,v\mapsto S,u+v,\qquad\mathrm{const}\ c:S\mapsto S,c.}
$$
Thus `add` pops two operands and pushes one <sum>, reducing <stack> occupancy by one. The special `const c` instruction pushes its immediate constant and increases occupancy by one. Only `const` needs an explicit value in its encoding.