Skip to content

Commit

Permalink
start and stop words
Browse files Browse the repository at this point in the history
  • Loading branch information
wa1tnr committed Jan 2, 2022
1 parent a318a06 commit f3a4031
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 232 deletions.
4 changes: 3 additions & 1 deletion core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ code blink 72 ,
code reflash 73 ,
code on 74 ,
code off 75 ,
-code /branch 76 ,
code fl@ 76 ,
code fl! 77 ,
-code /branch 78 ,

:m begin ( - a) here m;
:m again ( a) branch [ 2/ ] , m;
Expand Down
3 changes: 3 additions & 0 deletions libtnr.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
repeat
drop drop 1- drop
;

: stop -77 #, fl! ;
: start -22 #, fl! ;
284 changes: 142 additions & 142 deletions memory.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// memory.h

const uint16_t memory[] = {
929,
943,
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25,
Expand All @@ -11,114 +11,116 @@ const uint16_t memory[] = {
50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65,
66, 67, 68, 69, 70, 72, 73, 74,
75, 76, 0, 6, 1, 0, 22, 1,
0, 6, 65535, 65535, 22, 1, 0, 20,
41, 81, 11, 37, 4, 10, 92, 1,
14, 0, 14, 34, 0, 11, 20, 12,
20, 1, 0, 18, 75, 20, 34, 1,
0, 6, 32, 0, 4, 1, 0, 81,
11, 107, 4, 10, 122, 19, 1, 0,
53, 19, 1, 0, 6, 0, 0, 20,
54, 20, 19, 1, 0, 6, 0, 0,
20, 54, 19, 1, 0, 11, 6, 0,
0, 13, 54, 12, 20, 11, 54, 12,
1, 0, 11, 53, 12, 54, 1, 0,
162, 59, 1, 14, 68, 0, 172, 55,
81, 18, 172, 56, 44, 1, 0, 9,
190, 6, 45, 0, 174, 19, 1, 0,
99, 172, 56, 1, 0, 19, 19, 172,
55, 99, 21, 23, 1, 14, 70, 0,
6, 10, 0, 206, 44, 1, 0, 6,
16, 0, 206, 44, 1, 0, 206, 34,
149, 101, 6, 9, 0, 21, 23, 9,
240, 19, 6, 7, 0, 22, 18, 19,
6, 48, 0, 22, 174, 1, 0, 222,
21, 21, 27, 8, 257, 19, 7, 248,
19, 1, 0, 192, 247, 197, 119, 113,
1, 0, 6, 0, 0, 259, 1, 0,
9, 276, 57, 1, 0, 18, 11, 272,
192, 247, 12, 183, 197, 119, 113, 1,
0, 9, 297, 19, 6, 65535, 65535, 1,
19, 6, 0, 0, 1, 0, 18, 289,
277, 1, 0, 6, 0, 0, 1, 0,
6, 65535, 65535, 1, 0, 6, 32, 0,
1, 0, 21, 21, 23, 9, 332, 19,
20, 19, 1, 19, 19, 1, 0, 206,
34, 11, 215, 6, 0, 0, 192, 222,
222, 222, 222, 222, 222, 222, 222, 197,
119, 113, 12, 206, 44, 1, 0, 206,
34, 11, 215, 6, 0, 0, 192, 222,
222, 222, 222, 197, 119, 113, 12, 206,
44, 1, 0, 206, 34, 11, 215, 6,
0, 0, 192, 222, 222, 197, 119, 113,
12, 206, 44, 1, 0, 18, 359, 41,
113, 6, 7, 0, 11, 37, 359, 10,
406, 40, 1, 0, 18, 359, 39, 113,
6, 15, 0, 11, 51, 379, 10, 421,
38, 1, 0, 99, 39, 40, 43, 6,
255, 0, 26, 33, 11, 37, 42, 10,
438, 99, 107, 119, 113, 37, 359, 1,
0, 6, 3606, 0, 41, 1, 0, 25,
449, 40, 43, 8, 467, 19, 427, 25,
7, 458, 19, 1, 0, 97, 18, 34,
75, 21, 44, 18, 34, 22, 44, 1,
0, 18, 4, 1, 0, 307, 97, 45,
307, 19, 5, 317, 322, 317, 28, 8,
490, 317, 28, 481, 469, 5, 317, 322,
317, 28, 8, 515, 317, 28, 481, 469,
7, 502, 19, 317, 97, 18, 34, 22,
75, 44, 1, 0, 97, 39, 307, 40,
43, 6, 255, 0, 26, 33, 11, 52,
37, 23, 27, 10, 536, 37, 20, 8,
550, 19, 19, 307, 1, 19, 1, 0,
449, 40, 43, 8, 566, 19, 524, 8,
563, 1, 19, 7, 554, 1, 0, 6,
58, 0, 23, 9, 579, 6, 10, 0,
22, 1, 6, 29, 0, 23, 1, 0,
6, 0, 0, 5, 481, 317, 322, 317,
28, 8, 607, 317, 28, 567, 20, 32,
32, 32, 32, 27, 7, 588, 19, 1,
0, 485, 552, 1, 0, 35, 335, 1,
0, 8, 623, 19, 307, 1, 19, 312,
1, 0, 23, 617, 1, 0, 206, 34,
6, 16, 0, 23, 8, 642, 19, 302,
1, 19, 266, 1, 0, 48, 617, 8,
665, 19, 58, 10, 45, 45, 62, 32,
101, 109, 112, 116, 121, 32, 87, 1,
19, 48, 6, 1, 0, 626, 8, 685,
19, 18, 58, 4, 45, 45, 62, 32,
87, 630, 113, 1, 19, 58, 4, 45,
45, 62, 32, 87, 48, 18, 39, 20,
11, 81, 8, 703, 7, 696, 19, 38,
13, 630, 12, 20, 81, 8, 714, 7,
705, 19, 113, 1, 0, 485, 113, 552,
8, 731, 49, 48, 9, 728, 50, 19,
7, 718, 97, 107, 119, 50, 0, 6,
43, 0, 1, 0, 6, 0, 0, 75,
5, 18, 735, 19, 19, 18, 735, 626,
19, 18, 735, 626, 9, 763, 6, 32,
0, 4, 19, 18, 735, 626, 29, 9,
772, 21, 4, 19, 18, 317, 322, 735,
28, 8, 784, 19, 19, 7, 744, 19,
19, 81, 19, 1, 208, 62, 0, 58,
25, 116, 104, 105, 115, 32, 105, 115,
32, 103, 111, 105, 110, 103, 32, 116,
111, 32, 98, 101, 32, 103, 111, 111,
100, 32, 87, 1, 0, 70, 70, 70,
70, 70, 1, 0, 18, 75, 1, 0,
828, 828, 20, 23, 1, 0, 832, 22,
481, 1, 0, 6, 25, 0, 1, 0,
843, 72, 6, 100, 0, 24, 843, 73,
6, 800, 0, 24, 1, 0, 81, 11,
848, 10, 865, 58, 3, 111, 107, 32,
87, 1, 0, 58, 22, 32, 50, 32,
74, 97, 110, 32, 83, 117, 110, 100,
97, 121, 32, 32, 32, 49, 55, 58,
49, 49, 122, 87, 25, 58, 22, 114,
112, 50, 48, 52, 48, 45, 100, 118,
108, 112, 45, 100, 100, 45, 109, 117,
108, 116, 99, 45, 97, 87, 25, 1,
208, 62, 717, 65535, 65535, 65535, 65535, 65535,
75, 76, 77, 78, 0, 6, 1, 0,
22, 1, 0, 6, 65535, 65535, 22, 1,
0, 20, 41, 83, 11, 37, 4, 10,
94, 1, 14, 0, 14, 34, 0, 11,
20, 12, 20, 1, 0, 18, 77, 20,
34, 1, 0, 6, 32, 0, 4, 1,
0, 83, 11, 109, 4, 10, 124, 19,
1, 0, 53, 19, 1, 0, 6, 0,
0, 20, 54, 20, 19, 1, 0, 6,
0, 0, 20, 54, 19, 1, 0, 11,
6, 0, 0, 13, 54, 12, 20, 11,
54, 12, 1, 0, 11, 53, 12, 54,
1, 0, 164, 59, 1, 14, 68, 0,
174, 55, 83, 18, 174, 56, 44, 1,
0, 9, 192, 6, 45, 0, 176, 19,
1, 0, 101, 174, 56, 1, 0, 19,
19, 174, 55, 101, 21, 23, 1, 14,
70, 0, 6, 10, 0, 208, 44, 1,
0, 6, 16, 0, 208, 44, 1, 0,
208, 34, 151, 103, 6, 9, 0, 21,
23, 9, 242, 19, 6, 7, 0, 22,
18, 19, 6, 48, 0, 22, 176, 1,
0, 224, 21, 21, 27, 8, 259, 19,
7, 250, 19, 1, 0, 194, 249, 199,
121, 115, 1, 0, 6, 0, 0, 261,
1, 0, 9, 278, 57, 1, 0, 18,
11, 274, 194, 249, 12, 185, 199, 121,
115, 1, 0, 9, 299, 19, 6, 65535,
65535, 1, 19, 6, 0, 0, 1, 0,
18, 291, 279, 1, 0, 6, 0, 0,
1, 0, 6, 65535, 65535, 1, 0, 6,
32, 0, 1, 0, 21, 21, 23, 9,
334, 19, 20, 19, 1, 19, 19, 1,
0, 208, 34, 11, 217, 6, 0, 0,
194, 224, 224, 224, 224, 224, 224, 224,
224, 199, 121, 115, 12, 208, 44, 1,
0, 208, 34, 11, 217, 6, 0, 0,
194, 224, 224, 224, 224, 199, 121, 115,
12, 208, 44, 1, 0, 208, 34, 11,
217, 6, 0, 0, 194, 224, 224, 199,
121, 115, 12, 208, 44, 1, 0, 18,
361, 41, 115, 6, 7, 0, 11, 37,
361, 10, 408, 40, 1, 0, 18, 361,
39, 115, 6, 15, 0, 11, 51, 381,
10, 423, 38, 1, 0, 101, 39, 40,
43, 6, 255, 0, 26, 33, 11, 37,
42, 10, 440, 101, 109, 121, 115, 37,
361, 1, 0, 6, 3592, 0, 41, 1,
0, 25, 451, 40, 43, 8, 469, 19,
429, 25, 7, 460, 19, 1, 0, 99,
18, 34, 77, 21, 44, 18, 34, 22,
44, 1, 0, 18, 4, 1, 0, 309,
99, 45, 309, 19, 5, 319, 324, 319,
28, 8, 492, 319, 28, 483, 471, 5,
319, 324, 319, 28, 8, 517, 319, 28,
483, 471, 7, 504, 19, 319, 99, 18,
34, 22, 77, 44, 1, 0, 99, 39,
309, 40, 43, 6, 255, 0, 26, 33,
11, 52, 37, 23, 27, 10, 538, 37,
20, 8, 552, 19, 19, 309, 1, 19,
1, 0, 451, 40, 43, 8, 568, 19,
526, 8, 565, 1, 19, 7, 556, 1,
0, 6, 58, 0, 23, 9, 581, 6,
10, 0, 22, 1, 6, 29, 0, 23,
1, 0, 6, 0, 0, 5, 483, 319,
324, 319, 28, 8, 609, 319, 28, 569,
20, 32, 32, 32, 32, 27, 7, 590,
19, 1, 0, 487, 554, 1, 0, 35,
337, 1, 0, 8, 625, 19, 309, 1,
19, 314, 1, 0, 23, 619, 1, 0,
208, 34, 6, 16, 0, 23, 8, 644,
19, 304, 1, 19, 268, 1, 0, 48,
619, 8, 667, 19, 58, 10, 45, 45,
62, 32, 101, 109, 112, 116, 121, 32,
89, 1, 19, 48, 6, 1, 0, 628,
8, 687, 19, 18, 58, 4, 45, 45,
62, 32, 89, 632, 115, 1, 19, 58,
4, 45, 45, 62, 32, 89, 48, 18,
39, 20, 11, 83, 8, 705, 7, 698,
19, 38, 13, 632, 12, 20, 83, 8,
716, 7, 707, 19, 115, 1, 0, 487,
115, 554, 8, 733, 49, 48, 9, 730,
50, 19, 7, 720, 99, 109, 121, 50,
0, 6, 43, 0, 1, 0, 6, 0,
0, 77, 5, 18, 737, 19, 19, 18,
737, 628, 19, 18, 737, 628, 9, 765,
6, 32, 0, 4, 19, 18, 737, 628,
29, 9, 774, 21, 4, 19, 18, 319,
324, 737, 28, 8, 786, 19, 19, 7,
746, 19, 19, 83, 19, 1, 0, 6,
65459, 65535, 75, 1, 0, 6, 65514, 65535,
75, 1, 210, 62, 0, 58, 25, 116,
104, 105, 115, 32, 105, 115, 32, 103,
111, 105, 110, 103, 32, 116, 111, 32,
98, 101, 32, 103, 111, 111, 100, 32,
89, 1, 0, 70, 70, 70, 70, 70,
1, 0, 18, 77, 1, 0, 842, 842,
20, 23, 1, 0, 846, 22, 483, 1,
0, 6, 25, 0, 1, 0, 857, 72,
6, 100, 0, 24, 857, 73, 6, 800,
0, 24, 1, 0, 83, 11, 862, 10,
879, 58, 3, 111, 107, 32, 89, 1,
0, 58, 22, 32, 50, 32, 74, 97,
110, 32, 83, 117, 110, 100, 97, 121,
32, 32, 32, 49, 55, 58, 49, 49,
122, 89, 25, 58, 22, 114, 112, 50,
48, 52, 48, 45, 100, 118, 108, 112,
45, 100, 100, 45, 109, 117, 108, 116,
99, 45, 97, 89, 25, 1, 210, 62,
719, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
Expand Down Expand Up @@ -448,39 +450,37 @@ const uint16_t memory[] = {
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
65535, 65535, 65535, 65535, 65535, 26882, 8292, 875,
25094, 26988, 27502, 8307, 862, 25092, 26988, 8299,
848, 27651, 25701, 843, 28163, 29816, 838, 27140,
26988, 8308, 832, 25604, 26988, 8308, 828, 30470,
26473, 27751, 8293, 821, 29700, 29541, 8308, 791,
23554, 8284, 740, 23556, 21317, 8259, 735, 26889,
29806, 29285, 29296, 29797, 717, 11778, 8307, 645,
15617, 626, 12290, 8253, 617, 16129, 613, 9985,
609, 26626, 8227, 584, 26116, 28265, 8292, 552,
27909, 29793, 26723, 524, 28933, 25973, 31090, 485,
25860, 26723, 8303, 481, 29700, 25193, 8225, 469,
30469, 29295, 29540, 455, 25610, 25449, 26996, 28271,
29281, 8313, 449, 29185, 412, 25601, 397, 26627,
11875, 379, 26627, 11895, 359, 26626, 8238, 335,
27907, 30817, 322, 16898, 8268, 317, 29700, 30066,
8293, 312, 26117, 27745, 25971, 307, 11777, 302,
12290, 8252, 289, 25602, 8238, 277, 25604, 25185,
8307, 272, 29954, 8238, 266, 29955, 11876, 259,
8962, 8307, 247, 8961, 222, 26627, 30821, 215,
25607, 25445, 28009, 27745, 208, 25092, 29537, 8293,
206, 8962, 8254, 197, 15362, 8227, 192, 29444,
26473, 8302, 183, 26628, 27759, 8292, 174, 26630,
27759, 25956, 8306, 172, 10754, 8239, 168, 10757,
27951, 25711, 162, 29958, 12132, 28525, 8292, 149,
27907, 25711, 141, 12033, 132, 10753, 128, 29700,
28793, 8293, 119, 29445, 24944, 25955, 113, 25349,
30063, 29806, 107, 29187, 29807, 101, 28675, 25697,
99, 29699, 25193, 97, 28677, 31092, 25968, 87,
12546, 8237, 81, 12546, 8235, 75, 28419, 26214,
65535, 65535, 65535, 65535, 65535, 65535, 65535, 26882,
8292, 889, 25094, 26988, 27502, 8307, 876, 25092,
26988, 8299, 862, 27651, 25701, 857, 28163, 29816,
852, 27140, 26988, 8308, 846, 25604, 26988, 8308,
842, 30470, 26473, 27751, 8293, 835, 29700, 29541,
8308, 805, 29445, 24948, 29810, 797, 29444, 28532,
8304, 791, 23554, 8284, 742, 23556, 21317, 8259,
737, 26889, 29806, 29285, 29296, 29797, 719, 11778,
8307, 647, 15617, 628, 12290, 8253, 619, 16129,
615, 9985, 611, 26626, 8227, 586, 26116, 28265,
8292, 554, 27909, 29793, 26723, 526, 28933, 25973,
31090, 487, 25860, 26723, 8303, 483, 29700, 25193,
8225, 471, 30469, 29295, 29540, 457, 25610, 25449,
26996, 28271, 29281, 8313, 451, 29185, 414, 25601,
399, 26627, 11875, 381, 26627, 11895, 361, 26626,
8238, 337, 27907, 30817, 324, 16898, 8268, 319,
29700, 30066, 8293, 314, 26117, 27745, 25971, 309,
11777, 304, 12290, 8252, 291, 25602, 8238, 279,
25604, 25185, 8307, 274, 29954, 8238, 268, 29955,
11876, 261, 8962, 8307, 249, 8961, 224, 26627,
30821, 217, 25607, 25445, 28009, 27745, 210, 25092,
29537, 8293, 208, 8962, 8254, 199, 15362, 8227,
194, 29444, 26473, 8302, 185, 26628, 27759, 8292,
176, 26630, 27759, 25956, 8306, 174, 10754, 8239,
170, 10757, 27951, 25711, 164, 29958, 12132, 28525,
8292, 151, 27907, 25711, 143, 12033, 134, 10753,
130, 29700, 28793, 8293, 121, 29445, 24944, 25955,
115, 25349, 30063, 29806, 109, 29187, 29807, 103,
28675, 25697, 101, 29699, 25193, 99, 28677, 31092,
25968, 89, 12546, 8237, 83, 12546, 8235, 77,
26115, 8556, 75, 26115, 16492, 74, 28419, 26214,
73, 28418, 8302, 72, 29191, 26213, 24940, 26739,
71, 25093, 26988, 27502, 70, 19219, 31077, 28514,
29281, 11876, 25970, 25964, 29537, 16741, 27756, 69,
Expand Down
26 changes: 21 additions & 5 deletions sketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ uint16_t P=0; // program memory pointer
uint16_t A=0; // RAM pointer
unsigned long elapsed=0; // for counter timer
uint64_t D=0; // for double result of multiplication
uint8_t FL=0; // flags

// data stack
#define STKSIZE 16
Expand Down Expand Up @@ -538,6 +539,16 @@ void _Keyboard_end(){
Keyboard.end();
}

void _flstore(){
FL=T;
DROP;
}

void _flfetch(){
DUP;
T=FL;
}

void _execute();

void (*function[])()={
Expand All @@ -562,9 +573,13 @@ void (*function[])()={
_Keyboard_release , _Keyboard_releaseAll , _Keyboard_end , // 71
_blink_led , // 72 simple integer count
_reflashing , // 73

_on , // 74
_off , // 75
_dropzbranch , // 76
_flfetch, // 76
_flstore, // 77
_dropzbranch , // 78

};

void _execute(){
Expand Down Expand Up @@ -613,7 +628,6 @@ void setup(){
}

void setup1(){
// Serial.begin(9600);
delay(1);
for (volatile int pq = (3 + 2); pq > 0; pq--) {
cpl(LED_BUILTIN);
Expand Down Expand Up @@ -642,16 +656,18 @@ void loop(){

// second core

/*
#define INHIBIT 172700
void inhibit_blink_awhile(void) {
if ((millis() - elapsed) > INHIBIT) {
elapsed = millis();
}
}
*/

void loop1(){
// inhibit_blink_awhile();
blink_core_1();
// blink_core_1();
if (FL != 179) { // stop blinking
blink_core_1();
}
}
Loading

0 comments on commit f3a4031

Please sign in to comment.