SMETANA To Infinity!/brainfuck

A tape of 1-bit memory cells can be implemented like this:

# # # 4: Go to (the entry point for flipping the current cell). # 5: Go to (the entry point for moving left on the tape). # 6: Go to (the entry point for moving right on the tape). # 7: Go to (the entry point for testing the current cell). Step 100n + 200. Swap step 100n + 220 with step 100n + 221. Step 100n + 201. Go to step 1. Step 100n + 202. Swap step         4 with step 100n + 222. Step 100n + 203. Swap step         5 with step 100n + 223. Step 100n + 204. Swap step         6 with step 100n + 224. Step 100n + 205. Swap step         7 with step 100n + 225. Step 100n + 206. Swap step 100n + 122 with step         4. Step 100n + 207. Swap step 100n + 123 with step         5. Step 100n + 208. Swap step 100n + 124 with step         6. Step 100n + 209. Swap step 100n + 125 with step         7. Step 100n + 210. Go to step 1. Step 100n + 211. Swap step         4 with step 100n + 222. Step 100n + 212. Swap step         5 with step 100n + 223. Step 100n + 213. Swap step         6 with step 100n + 224. Step 100n + 214. Swap step         7 with step 100n + 225. Step 100n + 215. Swap step 100n + 322 with step         4. Step 100n + 216. Swap step 100n + 323 with step         5. Step 100n + 217. Swap step 100n + 324 with step         6. Step 100n + 218. Swap step 100n + 325 with step         7. Step 100n + 219. Go to step 1. Step 100n + 220. Go to step 2. Step 100n + 221. Go to step 3. Step 100n + 222. Go to step 100n + 200. Step 100n + 223. Go to step 100n + 202. Step 100n + 224. Go to step 100n + 211. Step 100n + 225. Go to step 100n + 220.
 * 1) We assume that steps 1 through 6 are laid out like this:
 * 1) 1 through 3: The desired return location for an operation returning...
 * 2)     1: ...no result.
 * 3)     2: ...a result of "0".
 * 4)     3: ...a result of "1".
 * 1) Entry point for flipping the current cell.
 * 2) We assume that step 1 is the desired return location.
 * 1) Entry point for moving left on the tape.
 * 1) Entry point for moving right on the tape.
 * 1) Storage location for the bit which is currently active.
 * 2) Also the entry point for testing the current cell.
 * 1) Storage location for the bit which is currently NOT active.
 * 1) Storage location for the instruction which is to be placed at step 4,
 * 2) when this cell is the current cell.
 * 1) Storage location for the instruction for step 5.
 * 1) Storage location for the instruction for step 6.
 * 1) Storage location for the instruction for step 7.

Then a brainfuck instruction meaning "flip the current cell" could be implemented like this:

Step 50. Swap step 54 with step 1. Step 51. Go to step 4. Step 52. Swap step 1 with step 54. Step 53. Go to step 55. Step 54. Go to step 52.
 * 1) Entry point for the instruction.
 * 2) First, place step 54 at step 1, so that control will return back here.
 * 1) Then go to step 4, which flips the bit and jumps back to 1,
 * 2) which jumps back to 52.
 * 1) Then put step 1 back in its original place.
 * 1) Finally, jump to the next instruction.
 * 1) Storage location for the jump back to step 52.

Instructions for moving left and right would look identical, but with Step 51 mentioning step 5 or 6 instead of 4.

An instruction for a conditional jump to another place could be implemented like this:

Step 60. Swap step 69 with step 2. Step 61. Swap step 70 with step 3. Step 62. Go to step 7. Step 63. Swap step 2 with step 69. Step 64. Swap step 3 with step 70. Step 65. Go to step 71. Step 66. Swap step 2 with step 69. Step 67. Swap step 3 with step 70. Step 68. Go to step 80. Step 69. Go to step 63. Step 70. Go to step 66.
 * 1) Entry point for the instruction.
 * 2) First, place steps 69 and 70 at steps 2 and 3,
 * 3) so that control will return back to us.
 * 1) Then go to step 7, which tests the bit and jumps back to 2 or 3.
 * 1) Landing point if it was 0.
 * 2) First, put steps 2 and 3 back in their original places.
 * 1) Then jump to the next instruction.
 * 1) Landing point if it was 1.
 * 2) Again, first put steps 2 and 3 back in their original places.
 * 1) Then jump off to some remote instruction.
 * 1) Storage location for the jump to step 63.
 * 1) Storage location for the jump to step 66.

All of this together provides the mechanisms needed to translate a 1-bit brainfuck program into SMETANA To Infinity!.