浏览代码

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 )


正在加载...
取消
保存