Hi 4tH-ers!
We've been pretty busy! First during a chat with Ron Aaron, author of the wonderful 8th compiler, I got an idea. What if I made the symbol table part of the 4tH structure? You could do cool things like:
4tH message: No errors at word 76
Object size: 76 words
String size: 85 chars
Variables : 1 cells
Strings : 0 chars
Symbols : 9 names
Reliable : Yes
Addr| Opcode Operand Argument
0| branch 14 enter
1| refill 0
2| drop 0
3| literal 32
4| dup 0
5| omit 0
6| parse 0
7| number 0
8| literal -2147483648
9| over 0
10| = 0
11| 0branch 13
12| drop 0
13| branch 0 enter
14| exit 0
15| branch 25
16| value 0 seed
17| * 0
18| + 0
19| dup 0
20| to 0 seed
21| literal -16
22| shift 0
23| literal 32767
24| and 0
25| exit 0
26| branch 29 random
27| literal 12345
28| literal 1103515245
29| branch 15
30| branch 33 MSrandom
31| literal 2531011
32| literal 214013
33| branch 15
34| branch 37 randomize
35| time 0
36| to 0 seed
37| exit 0
38| branch 73 guesses
39| call 34 randomize
40| call 26 random
41| literal 10
42| mod 0
43| +literal 1
44| swap 0
45| ." 0 Guess a number between 1 and 10
46| cr 0
47| dup 0
48| 0branch 68
49| over 0
50| call 0 enter
51| over 0
52| over 0
53| = 0
54| 0branch 59
55| literal 1
56| use 0
57| ." 32 Guessed!
58| cr 0
59| quit 0
60| ." 41 Too
61| > 0
62| 0branch 64
63| ." 46 small
64| branch 65
65| ." 52 big
66| cr 0
67| +literal -1
68| branch 46
69| drop 0
70| ." 56 You didn't guess it, it was
71| . 0
72| cr 0
73| exit 0
74| literal 3
75| call 38 guessesYes! Append labels to already compiled code. Note it only works for things that do NOT compile to a literal, but those are quite a few. As you can see, I updated the report itself (unchanged since 1994) as well.
And we applied a few fixes that boost the compilation performance with 25%! Yes, even on my simple P4, 4tH compiles with a rate of 10 MILLION lines per minute.
Keep you posted! And code in SVN.
Hans Bezemer