Move a bunch of words from core to xcomp core

This commit is contained in:
Virgil Dupras 2020-05-13 08:50:07 -04:00
parent d6a3e79394
commit e2e9faef2c
8 changed files with 12 additions and 22 deletions

View File

@ -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 21 LOADR+ 1 22 LOADR+

View File

@ -1,11 +1,13 @@
: '? WORD (find) ;
: '
'? (?br) [ 4 , ] EXIT
LIT< (wnf) (find) DROP EXECUTE
;
: ROLL : ROLL
DUP NOT IF EXIT THEN DUP NOT IF EXIT THEN
1+ DUP PICK ( n val ) 1+ DUP PICK ( n val )
SWAP 2 * (roll) ( val ) SWAP 2 * (roll) ( val )
SWAP DROP SWAP DROP
; ;
: 2OVER 3 PICK 3 PICK ; : 2OVER 3 PICK 3 PICK ;
: 2SWAP 3 ROLL 3 ROLL ; : 2SWAP 3 ROLL 3 ROLL ;

View File

View File

@ -9,5 +9,7 @@
34 , ( 34 == litWord ) ," 0 C, 34 , ( 34 == litWord ) ," 0 C,
COMPILE (print) COMPILE (print)
; IMMEDIATE ; IMMEDIATE
: ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE : ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE
: BS 8 EMIT ; : LF 10 EMIT ; : CR 13 EMIT ;
: CRLF CR LF ; : SPC 32 EMIT ;
: NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ;

View File

@ -2,11 +2,6 @@
: ] R> DROP ; : ] R> DROP ;
: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE : LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE
: LITA 36 , , ; : LITA 36 , , ;
: '? WORD (find) ;
: '
'? (?br) [ 4 , ] EXIT
LIT< (wnf) (find) DROP EXECUTE
;
: ['] ' LITA ; IMMEDIATE : ['] ' LITA ; IMMEDIATE
: COMPILE ' LITA ['] , , ; IMMEDIATE : COMPILE ' LITA ['] , , ; IMMEDIATE
: [COMPILE] ' , ; IMMEDIATE : [COMPILE] ' , ; IMMEDIATE

View File

@ -7,4 +7,6 @@
= UNTIL = UNTIL
DROP DROP
; ;
: (ok) SPC ." ok" NL ;
: (uflw) ABORT" stack underflow" ;
: (wnf) (print) SPC ABORT" word not found" ;

11
blk/440
View File

@ -1,11 +0,0 @@
: (uflw) ABORT" stack underflow" ;
: BS 8 EMIT ;
: LF 10 EMIT ;
: CR 13 EMIT ;
: CRLF CR LF ;
: SPC 32 EMIT ;
: NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ;
: (wnf) (print) SPC ABORT" word not found" ;
: (ok) SPC ." ok" NL ;

Binary file not shown.