ソースを参照

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

pull/95/head
Virgil Dupras 4年前
コミット
8186511727
2個のファイルの変更18行の追加7行の削除
  1. バイナリ
      emul/forth/z80c.bin
  2. +18
    -7
      forth/icore.fs

バイナリ
emul/forth/z80c.bin ファイルの表示


+ 18
- 7
forth/icore.fs ファイルの表示

@@ -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 )


読み込み中…
キャンセル
保存