Browse Source

Simplify LOAD's INTERPRET exit mechanism

pull/102/head
Virgil Dupras 4 years ago
parent
commit
80d730318a
5 changed files with 1 additions and 22 deletions
  1. +0
    -1
      blk/044
  2. +0
    -9
      blk/409
  3. +0
    -11
      blk/432
  4. +1
    -1
      blk/433
  5. BIN
      emul/forth.bin

+ 0
- 1
blk/044 View File

@@ -2,4 +2,3 @@ INTERPRET -- Get a line from stdin, compile it in tmp memory,
then execute the compiled contents.
LEAVE -- In a DO..LOOP, exit at the next LOOP call.
QUIT -- Return to interpreter prompt immediately
EXIT! -- Exit current INTERPRET loop.

+ 0
- 9
blk/409 View File

@@ -5,12 +5,3 @@
NOT IF (parse) ELSE EXECUTE THEN
C<? NOT IF LIT< (ok) (find) IF EXECUTE THEN THEN
AGAIN ;

( Drop RSP until I-2 == INTERPRET. )
: EXIT!
['] INTERPRET ( I )
BEGIN ( I )
DUP ( I I )
R> DROP I 2- @ ( I I a )
= UNTIL
DROP ;

+ 0
- 11
blk/432 View File

@@ -1,14 +1,3 @@
: _
(boot<)
DUP 4 = IF
( We drop our char, but also "a" from WORD: it won't
have the opportunity to balance PSP because we're
EXIT!ing. )
2DROP
( We're finished interpreting )
EXIT!
THEN
;
( 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


+ 1
- 1
blk/433 View File

@@ -5,7 +5,7 @@
0x2e RAM+ @ >R ( boot ptr )
BLK@
BLK( 0x2e RAM+ ! ( Point to beginning of BLK )
['] _ 0x08 RAM+ !
['] (boot<) 0x08 RAM+ !
1 0x06 RAM+ ! ( 06 == C<? )
INTERPRET
R> 0x2e RAM+ ! R> 0x06 RAM+ !


BIN
emul/forth.bin View File


Loading…
Cancel
Save