mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-06 03:30:55 +11:00
2d17b4e8ec
I'm not sure why I chose null-terminated initially. Probably because the z80asm version had null-terminated strings. Length-prefixes strings are the traditional form of strings in Forth and it's a bit easier to work with them with traditional forth words when they're under this form.
16 lines
547 B
Plaintext
16 lines
547 B
Plaintext
: INTERPRET
|
|
BEGIN
|
|
WORD DUP @ 0x0401 = ( EOT ) IF DROP EXIT THEN
|
|
FIND NOT IF (parse) ELSE EXECUTE THEN
|
|
C<? NOT IF SPC LIT< ok (print) NL THEN
|
|
AGAIN ;
|
|
( Read from BOOT C< PTR and inc it. )
|
|
: (boot<)
|
|
( 2e == BOOT C< PTR )
|
|
0x2e ( BOOT C< PTR ) RAM+ @ DUP C@ ( a c )
|
|
SWAP 1 + 0x2e RAM+ ! ( c ) ;
|
|
( pre-comment for tight LOAD: The 0x08==I check after INTERPRET
|
|
is to check whether we're restoring to "_", the word above.
|
|
if yes, then we're in a nested load. Also, the 1 in 0x06 is
|
|
to avoid tons of "ok" displays. )
|