Sat Sep 14 10:13:12 EDT 2013
Just forth again...
Trying to solve "back-patching" of table length.
Seems that code only supports label operations, and labels are 2-word
aligned, so won't cooperate properly with ","
: foo begin 1 , 2 , 3 , 4 , 5 , begin m> m> - ,, ;
This seems to give the number of words, rounded up. Let's extend the
, word with a word that returns 0 or 1 depending on the number of
The following works, but the presence of a lable terminates the table.
So you can't ',' the value coming from table-end.
: table-begin begin ;
: table-end \ -- table-size
byte-slots >m m-swap begin m> m> - 2 * m> - ;
I guess I can work around this with several hacks, but the simplest
approach seems to b to just generate the tables in Scheme, or to patch
the sizes manually which is a bit silly.
Disappointing that such a simple thing is excluded by the structure
because it is word-oriented, and byte compilation is a hack.
Maybe this just needs an external tool. I'll be building USB
descriptors for other languages too..