mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 19:48:06 +11:00
Move a bunch of words from core to inner core
That makes it easier to write drivers that can be xcompiled.
This commit is contained in:
parent
ffdc58739a
commit
baf725aa38
2
blk/393
2
blk/393
@ -12,4 +12,4 @@
|
|||||||
0 0x08 RAM+ ! ( 08 == C<* override )
|
0 0x08 RAM+ ! ( 08 == C<* override )
|
||||||
LIT< INTERPRET (find) DROP EXECUTE
|
LIT< INTERPRET (find) DROP EXECUTE
|
||||||
;
|
;
|
||||||
1 20 LOADR+
|
1 21 LOADR+
|
||||||
|
22
blk/412
22
blk/412
@ -1,14 +1,8 @@
|
|||||||
( LITN has to be defined after the last immediate usage of
|
: H@ HERE @ ;
|
||||||
it to avoid bootstrapping issues )
|
: IMMEDIATE
|
||||||
: LITN 32 , , ( 32 == NUMBER ) ;
|
CURRENT @ 1-
|
||||||
|
DUP C@ 128 OR SWAP C!
|
||||||
: IMMED? 1- C@ 0x80 AND ;
|
;
|
||||||
|
: +! SWAP OVER @ + SWAP ! ;
|
||||||
( ';' can't have its name right away because, when created, it
|
: -^ SWAP - ;
|
||||||
is not an IMMEDIATE yet and will not be treated properly by
|
: ALLOT HERE +! ;
|
||||||
xcomp. )
|
|
||||||
: _
|
|
||||||
['] EXIT ,
|
|
||||||
R> DROP ( exit : )
|
|
||||||
; IMMEDIATE
|
|
||||||
|
|
||||||
|
30
blk/413
30
blk/413
@ -1,16 +1,14 @@
|
|||||||
XCURRENT @ ( to PSP )
|
( LITN has to be defined after the last immediate usage of
|
||||||
: :
|
it to avoid bootstrapping issues )
|
||||||
(entry)
|
: LITN 32 , , ( 32 == NUMBER ) ;
|
||||||
( We cannot use LITN as IMMEDIATE because of bootstrapping
|
|
||||||
issues. Same thing for ",".
|
: IMMED? 1- C@ 0x80 AND ;
|
||||||
32 == NUMBER 14 == compiledWord )
|
|
||||||
[ 32 H@ ! 2 ALLOT 14 H@ ! 2 ALLOT ] C,
|
( ';' can't have its name right away because, when created, it
|
||||||
BEGIN
|
is not an IMMEDIATE yet and will not be treated properly by
|
||||||
WORD
|
xcomp. )
|
||||||
(find)
|
: _
|
||||||
( is word )
|
['] EXIT ,
|
||||||
IF DUP IMMED? IF EXECUTE ELSE , THEN
|
R> DROP ( exit : )
|
||||||
( maybe number )
|
; IMMEDIATE
|
||||||
ELSE (parse) LITN THEN
|
|
||||||
AGAIN ;
|
|
||||||
( from PSP ) ';' SWAP 4 - C!
|
|
||||||
|
16
blk/414
Normal file
16
blk/414
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
XCURRENT @ ( to PSP )
|
||||||
|
: :
|
||||||
|
(entry)
|
||||||
|
( We cannot use LITN as IMMEDIATE because of bootstrapping
|
||||||
|
issues. Same thing for ",".
|
||||||
|
32 == NUMBER 14 == compiledWord )
|
||||||
|
[ 32 H@ ! 2 ALLOT 14 H@ ! 2 ALLOT ] C,
|
||||||
|
BEGIN
|
||||||
|
WORD
|
||||||
|
(find)
|
||||||
|
( is word )
|
||||||
|
IF DUP IMMED? IF EXECUTE ELSE , THEN
|
||||||
|
( maybe number )
|
||||||
|
ELSE (parse) LITN THEN
|
||||||
|
AGAIN ;
|
||||||
|
( from PSP ) ';' SWAP 4 - C!
|
5
blk/422
5
blk/422
@ -1,8 +1,3 @@
|
|||||||
: H@ HERE @ ;
|
|
||||||
: IMMEDIATE
|
|
||||||
CURRENT @ 1-
|
|
||||||
DUP C@ 128 OR SWAP C!
|
|
||||||
;
|
|
||||||
: [ INTERPRET ; IMMEDIATE
|
: [ INTERPRET ; IMMEDIATE
|
||||||
: ] R> DROP ;
|
: ] R> DROP ;
|
||||||
: LITS 34 , SCPY ;
|
: LITS 34 , SCPY ;
|
||||||
|
4
blk/425
4
blk/425
@ -1,7 +1,3 @@
|
|||||||
: +! SWAP OVER @ + SWAP ! ;
|
|
||||||
: -^ SWAP - ;
|
|
||||||
: ALLOT HERE +! ;
|
|
||||||
|
|
||||||
: IF ( -- a | a: br cell addr )
|
: IF ( -- a | a: br cell addr )
|
||||||
COMPILE (?br)
|
COMPILE (?br)
|
||||||
H@ ( push a )
|
H@ ( push a )
|
||||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user