Pārlūkot izejas kodu

forth: fix bootstrapping issues with "LITN" and "+"

pull/95/head
Virgil Dupras pirms 4 gadiem
vecāks
revīzija
8186511727
2 mainītis faili ar 18 papildinājumiem un 7 dzēšanām
  1. Binārs
      emul/forth/z80c.bin
  2. +18
    -7
      forth/icore.fs

Binārs
emul/forth/z80c.bin Parādīt failu


+ 18
- 7
forth/icore.fs Parādīt failu

@@ -17,6 +17,12 @@
properly stabilized.
4. Make sure that the words you compile are not overridden
by the full interpreter.
5. When using words as immediates, make sure that they're
not defined in icore or, if they are, make sure that
they contain no "_c" references.

All these rules make this unit a bit messy, but this is the
price to pay for the awesomeness of self-bootstrapping.
)

( When referencing words from native defs or this very unit,
@@ -49,7 +55,10 @@
, ( write! )
; IMMEDIATE

: QUIT 0 FLAGS ! _c (resRS) LIT< INTERPRET (find) DROP EXECUTE ;
: QUIT
0 FLAGS ! _c (resRS)
LIT< INTERPRET (find) DROP EXECUTE
;

: ABORT _c (resSP) _c QUIT ;

@@ -116,12 +125,6 @@
[ JTBL 30 + @ LITN ]
;

: LITN
( JTBL+24 == NUMBER )
JTBL 24 _c + ,
,
;

: (entry)
HERE @ ( h )
_c WORD ( h s )
@@ -159,6 +162,14 @@
_c INTERPRET
;

( LITN has to be defined after the last immediate usage of
it to avoid bootstrapping issues )
: LITN
( JTBL+24 == NUMBER )
JTBL 24 _c + ,
,
;

( : and ; have to be defined last because it can't be
executed now also, they can't have their real name
right away )


Notiek ielāde…
Atcelt
Saglabāt