First decrement and increment is done
This commit is contained in:
parent
36dab4ec15
commit
069368a13a
54 changed files with 311 additions and 50 deletions
93
adder.tm
93
adder.tm
|
@ -3,35 +3,80 @@
|
|||
11:0,1,12,0,0,0
|
||||
12:0,1,13,0,0,0
|
||||
13:0,1,14,0,0,0
|
||||
14:1,0,15,0,0,0
|
||||
|
||||
# At card 15 we flip a bit at registry position -4 to indicate an 8 in the negative registry, then we jump to 140
|
||||
15:0,0,140,0,0,0
|
||||
# At card 14 we flip a bit at registry position -4 to indicate an 8 in the negative registry, then for completness we continue up the registry
|
||||
14:1,1,15,0,0,0
|
||||
15:0,1,16,0,0,0
|
||||
16:0,1,17,0,0,0
|
||||
17:0,1,18,0,0,0
|
||||
18:0,0,107,0,0,0
|
||||
|
||||
# At card 21 write a one and move to 22
|
||||
# At this point we are starting to move back up the negative registry
|
||||
107:0,0,106,1,0,106
|
||||
106:0,0,105,1,0,105
|
||||
105:0,0,104,1,0,104
|
||||
104:0,0,103,1,0,103
|
||||
103:0,0,102,1,0,102
|
||||
102:0,0,101,1,0,101
|
||||
101:0,0,100,1,0,100
|
||||
100:0,0,21,1,0,21
|
||||
|
||||
# Move we are at the registry pos 1 where we write a 1 and move to reg pos 2
|
||||
21:1,0,22,0,0,0
|
||||
|
||||
# At card 22 write a one and jump to 210 where we start to move back to registry pos 0
|
||||
22:1,1,210,1,1,210
|
||||
# A reg pos 2 we also write a one to get the binary number 3, for completeness we continue up the registry to pos 8 and then go back
|
||||
22:1,0,23,0,0,0
|
||||
23:0,0,24,0,0,0
|
||||
24:0,0,25,0,0,0
|
||||
25:0,0,26,0,0,0
|
||||
26:0,0,27,0,0,0
|
||||
27:0,0,28,0,0,0
|
||||
28:0,1,207,0,0,0
|
||||
|
||||
# At 30 - 38 we keep a decrementer
|
||||
30:1,1,31,0,0,0
|
||||
31:1,1,32,0,0,0
|
||||
32:1,1,33,0,0,0
|
||||
33:1,1,34,0,0,0
|
||||
34:1,1,35,0,0,0
|
||||
35:1,1,36,0,0,0
|
||||
36:1,1,37,0,0,0
|
||||
37:1,1,38,0,0,0
|
||||
38:1,1,0,0,0,0
|
||||
# Now we go back to reg pos 0
|
||||
207:0,1,206,1,1,206
|
||||
206:0,1,205,1,1,205
|
||||
205:0,1,204,1,1,204
|
||||
204:0,1,203,1,1,203
|
||||
203:0,1,202,1,1,202
|
||||
202:0,1,201,1,1,201
|
||||
201:0,1,200,1,1,200
|
||||
|
||||
# 140 - 142 just moves us back to registry pos 0
|
||||
140:0,0,141,1,0,141
|
||||
141:0,0,142,1,0,142
|
||||
# Here we are back to registry pos 0 where we jump to the decrementer, the idea is to decrement the negative registry
|
||||
# and increment the positive registry until the negative registry is zero
|
||||
200:0,1,30,0,1,30
|
||||
|
||||
# At 142 we jump to 21
|
||||
142:0,0,21,0,0,21
|
||||
# This is a decrementer for registry -1 through -8
|
||||
# decrement: if 1 write 0: end
|
||||
# if 0 write 1 move to next
|
||||
30:1,1,31,0,0,40
|
||||
31:1,1,32,0,0,301
|
||||
32:1,1,33,0,0,302
|
||||
33:1,1,34,0,0,303
|
||||
34:1,1,35,0,0,302
|
||||
35:1,1,36,0,0,304
|
||||
36:1,1,37,0,0,305
|
||||
37:1,1,38,0,0,306
|
||||
38:1,1,307,0,0,307
|
||||
|
||||
# Here we move back to registry pos 0 and then jump to 30
|
||||
210:0,1,211,1,1,211
|
||||
211:0,1,30,1,1,30
|
||||
# Here we need to go back to reg pos 0 after the decrementer is done
|
||||
300:0,0,41,0,0,41
|
||||
301:0,0,300,1,0,300
|
||||
302:0,0,301,1,0,301
|
||||
303:0,0,302,1,0,302
|
||||
304:0,0,303,1,0,303
|
||||
305:0,0,304,1,0,304
|
||||
306:0,0,305,1,0,305
|
||||
307:0,0,306,1,0,306
|
||||
|
||||
# Here we need to increment the positive registry
|
||||
# increment: if 0 write 1: end
|
||||
# if 1 write 0 move to next
|
||||
41:1,0,0,0,0,42
|
||||
42:1,0,0,0,0,43
|
||||
43:1,0,0,0,0,44
|
||||
44:1,0,0,0,0,45
|
||||
45:1,0,0,0,0,46
|
||||
46:1,0,0,0,0,47
|
||||
47:1,1,0,0,0,48
|
||||
48:1,1,0,0,0,0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
0
|
||||
0
|
||||
21
|
||||
0
|
||||
1
|
||||
0
|
||||
21
|
|
@ -1,6 +1,6 @@
|
|||
0
|
||||
0
|
||||
141
|
||||
100
|
||||
1
|
||||
0
|
||||
141
|
||||
100
|
|
@ -1,6 +1,6 @@
|
|||
0
|
||||
0
|
||||
142
|
||||
101
|
||||
1
|
||||
0
|
||||
142
|
||||
101
|
6
cards/103
Normal file
6
cards/103
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
102
|
||||
1
|
||||
0
|
||||
102
|
6
cards/104
Normal file
6
cards/104
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
103
|
||||
1
|
||||
0
|
||||
103
|
6
cards/105
Normal file
6
cards/105
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
104
|
||||
1
|
||||
0
|
||||
104
|
6
cards/106
Normal file
6
cards/106
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
105
|
||||
1
|
||||
0
|
||||
105
|
6
cards/107
Normal file
6
cards/107
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
106
|
||||
1
|
||||
0
|
||||
106
|
2
cards/14
2
cards/14
|
@ -1,5 +1,5 @@
|
|||
1
|
||||
0
|
||||
1
|
||||
15
|
||||
0
|
||||
0
|
||||
|
|
4
cards/15
4
cards/15
|
@ -1,6 +1,6 @@
|
|||
0
|
||||
0
|
||||
140
|
||||
1
|
||||
16
|
||||
0
|
||||
0
|
||||
0
|
||||
|
|
6
cards/16
Normal file
6
cards/16
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
17
|
||||
0
|
||||
0
|
||||
0
|
6
cards/17
Normal file
6
cards/17
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
18
|
||||
0
|
||||
0
|
||||
0
|
6
cards/18
Normal file
6
cards/18
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
107
|
||||
0
|
||||
0
|
||||
0
|
|
@ -1,6 +1,6 @@
|
|||
0
|
||||
1
|
||||
30
|
||||
1
|
||||
0
|
||||
1
|
||||
30
|
|
@ -1,6 +1,6 @@
|
|||
0
|
||||
1
|
||||
211
|
||||
200
|
||||
1
|
||||
1
|
||||
211
|
||||
200
|
6
cards/202
Normal file
6
cards/202
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
201
|
||||
1
|
||||
1
|
||||
201
|
6
cards/203
Normal file
6
cards/203
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
202
|
||||
1
|
||||
1
|
||||
202
|
6
cards/204
Normal file
6
cards/204
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
203
|
||||
1
|
||||
1
|
||||
203
|
6
cards/205
Normal file
6
cards/205
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
204
|
||||
1
|
||||
1
|
||||
204
|
6
cards/206
Normal file
6
cards/206
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
205
|
||||
1
|
||||
1
|
||||
205
|
6
cards/207
Normal file
6
cards/207
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
206
|
||||
1
|
||||
1
|
||||
206
|
10
cards/22
10
cards/22
|
@ -1,6 +1,6 @@
|
|||
1
|
||||
1
|
||||
210
|
||||
1
|
||||
1
|
||||
210
|
||||
0
|
||||
23
|
||||
0
|
||||
0
|
||||
0
|
||||
|
|
6
cards/23
Normal file
6
cards/23
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
24
|
||||
0
|
||||
0
|
||||
0
|
6
cards/24
Normal file
6
cards/24
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
25
|
||||
0
|
||||
0
|
||||
0
|
6
cards/25
Normal file
6
cards/25
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
26
|
||||
0
|
||||
0
|
||||
0
|
6
cards/26
Normal file
6
cards/26
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
27
|
||||
0
|
||||
0
|
||||
0
|
6
cards/27
Normal file
6
cards/27
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
28
|
||||
0
|
||||
0
|
||||
0
|
6
cards/28
Normal file
6
cards/28
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
1
|
||||
207
|
||||
0
|
||||
0
|
||||
0
|
2
cards/30
2
cards/30
|
@ -3,4 +3,4 @@
|
|||
31
|
||||
0
|
||||
0
|
||||
0
|
||||
40
|
||||
|
|
6
cards/300
Normal file
6
cards/300
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
41
|
||||
0
|
||||
0
|
||||
41
|
6
cards/301
Normal file
6
cards/301
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
300
|
||||
1
|
||||
0
|
||||
300
|
6
cards/302
Normal file
6
cards/302
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
301
|
||||
1
|
||||
0
|
||||
301
|
6
cards/303
Normal file
6
cards/303
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
302
|
||||
1
|
||||
0
|
||||
302
|
6
cards/304
Normal file
6
cards/304
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
303
|
||||
1
|
||||
0
|
||||
303
|
6
cards/305
Normal file
6
cards/305
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
304
|
||||
1
|
||||
0
|
||||
304
|
6
cards/306
Normal file
6
cards/306
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
305
|
||||
1
|
||||
0
|
||||
305
|
6
cards/307
Normal file
6
cards/307
Normal file
|
@ -0,0 +1,6 @@
|
|||
0
|
||||
0
|
||||
306
|
||||
1
|
||||
0
|
||||
306
|
2
cards/31
2
cards/31
|
@ -3,4 +3,4 @@
|
|||
32
|
||||
0
|
||||
0
|
||||
0
|
||||
301
|
||||
|
|
2
cards/32
2
cards/32
|
@ -3,4 +3,4 @@
|
|||
33
|
||||
0
|
||||
0
|
||||
0
|
||||
302
|
||||
|
|
2
cards/33
2
cards/33
|
@ -3,4 +3,4 @@
|
|||
34
|
||||
0
|
||||
0
|
||||
0
|
||||
303
|
||||
|
|
2
cards/34
2
cards/34
|
@ -3,4 +3,4 @@
|
|||
35
|
||||
0
|
||||
0
|
||||
0
|
||||
302
|
||||
|
|
2
cards/35
2
cards/35
|
@ -3,4 +3,4 @@
|
|||
36
|
||||
0
|
||||
0
|
||||
0
|
||||
304
|
||||
|
|
2
cards/36
2
cards/36
|
@ -3,4 +3,4 @@
|
|||
37
|
||||
0
|
||||
0
|
||||
0
|
||||
305
|
||||
|
|
2
cards/37
2
cards/37
|
@ -3,4 +3,4 @@
|
|||
38
|
||||
0
|
||||
0
|
||||
0
|
||||
306
|
||||
|
|
4
cards/38
4
cards/38
|
@ -1,6 +1,6 @@
|
|||
1
|
||||
1
|
||||
307
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
307
|
||||
|
|
6
cards/41
Normal file
6
cards/41
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
42
|
6
cards/42
Normal file
6
cards/42
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
43
|
6
cards/43
Normal file
6
cards/43
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
44
|
6
cards/44
Normal file
6
cards/44
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
45
|
6
cards/45
Normal file
6
cards/45
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
46
|
6
cards/46
Normal file
6
cards/46
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
47
|
6
cards/47
Normal file
6
cards/47
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
48
|
6
cards/48
Normal file
6
cards/48
Normal file
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
Loading…
Add table
Reference in a new issue