Algorithm (truncated computation of register machine)

Input: $\op{code}(M), \op{code}(k), \op{code}(\v w), v$.

  1. Empty an unused register $i$.

  2. If the content of register $i$ equals $v$:

    1. Output $ε$ and halt.

  3. Otherwise:

    1. Compute $(q,\v w') = C(\#(u), M, \v w)$ where $u$ is the content of register $i$.

    2. If $q = q_\mathrm{H}$:

      1. Output $a$ and halt.

    3. Otherwise:

      1. Apply the successor function to register $k$.

      2. Go to 2.

The loop can only be called at most $\#(v)$ times, so this must halt in finite time.