On 6/20/24 05:10, albert@spenarnc.xs4all.nl wrote:
There was a lecture on interpreted control structure in Zeptoforth.
That was in the forth2020 conference of april 2024
I was surprised. In particular it doesnot work for looping
building up the dictionary, e.g.
CREATE CRCTable
100 0 DO I 8 0 DO
DUP >R 1 RSHIFT R> 1 AND IF CRC64_POLYNOMIAL XOR THEN
LOOP , LOOP
This IMO is the most useful application.
The reason for this is that interpreted control structures in zeptoforth >really are not interpreted at all. Rather, they are treated as saving
the RAM HERE pointer for later restoration and temporarily putting
zeptoforth into compilation state, with the HERE pointer pointing into
RAM, until all the outstanding control structures are closed, where then
all the newly compiled code is executed and then promptly forgotten and
the original RAM HERE pointer is restored (and if the HERE pointer
previously pointed into flash, pointing HERE into flash again).
zeptoforth makes no assumptions about the position of the top edge of
the main task's dictionary because new tasks are allotted from high
memory down, and if memory were allotted in high memory it would either
be overwritten by new tasks, or would be permanently lost if a new task
were created, depending on how exactly this were implemented.
Travis--
On 20/06/2024 8:10 pm, albert@spenarnc.xs4all.nl wrote:
...
CREATE CRCTable
100 0 DO I 8 0 DO
DUP >R 1 RSHIFT R> 1 AND IF CRC64_POLYNOMIAL XOR THEN
LOOP , LOOP
This IMO is the most useful application.
One hopes not since ...
CREATE CRCTable 100 CELLS ALLOT
: !CRC ( -- ) CRCTable 100 0 DO I 8 0 DO
DUP >R 1 RSHIFT R> 1 AND IF CRC64_POLYNOMIAL XOR THEN
LOOP OVER ! CELL+ LOOP DROP ; !CRC FORGET !CRC
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 504 |
Nodes: | 16 (2 / 14) |
Uptime: | 01:00:24 |
Calls: | 9,895 |
Calls today: | 4 |
Files: | 13,797 |
Messages: | 6,297,202 |
Posted today: | 2 |