If ij then it is
FindReg i Move to register i
L3
Write 1 Leave mark
Lto 2 1
... (i-j times) Move to register j
Lto 2 1
L Move to actual bit
:L0: Henceforth c=0
`0 0 0 L 1; 0 1 1 L :L2:' Read b -- henceforth b=0
L2
Write 1 Leave mark
R
Rto 2 1
... (i-j times) Find delimiter at start of register i
Rto 2 1
`0 0 0 R 1; 0 1 1 R :L6:' If this is the last bit, go to :L6:
Rto 2 1 If not, find mark
`0 0 0 L 1; 0 1 1 L 1' and add in b(=0) and c(=0); find new carry
:L1:
Write 0 Remove old mark
L4
Write 1 and write new one
L
Lto 2 1
... (i-j+1 times) Find mark left in register j
Lto 2 1
R
Write 0 Remove it
L Move to next bit
Goto :L0: and loop round
:L2: Henceforth b=1
L2
Write 1
R
Rto 2 1
... (i-j times)
Rto 2 1
`0 0 0 R 1; 0 1 1 R :L7:'
Rto 2 1
`0 0 1 L 1; 0 1 0 L :L4:' Add in b(=1) and c(=0); find new carry
Goto :L1:
:L3: Henceforth c=1
`0 0 0 L 1; 0 1 1 L :L5:' Read b -- henceforth b=0
L2
Write 1
R
Rto 2 1
... (i-j times)
Rto 2 1
`0 0 0 R 1; 0 1 1 R :L7:'
Rto 2 1
`0 0 1 L :L1:; 0 1 0 L 1' Add in b(=0) and c(=1); find new carry
:L4:
Write 0
L4
Write 1
L
Lto 2 1
... (i-j+1 times)
Lto 2 1
R
Write 0
L
Goto :L3:
:L5: Henceforth b=1
L2
Write 1
R
Rto 2 1
... (i-j times)
Rto 2 1
`0 0 0 R 1; 0 1 1 R :L6:'
Rto 2 1
`0 0 0 L 1; 0 1 1 L 1' Add in b(=1) and c(=1); find new carry
Goto :L4:
:L6:
`0 0 0 L :L8:; 0 1 1 L :L8:' Add final bit (b+c=0)
:L7:
`0 0 1 L 1; 0 1 0 L 1' Add final bit (b+c=1)
:L8:
Write 0 Remove mark
L
FindStart Return to home position