Move (print) and (uflw) from icore to core

This commit is contained in:
Virgil Dupras 2020-04-03 07:44:44 -04:00
parent c56386af02
commit b575d7f863
5 changed files with 19 additions and 20 deletions

Binary file not shown.

Binary file not shown.

View File

@ -30,10 +30,10 @@ NOP, NOP, ( 26, unused )
0 JPnn, ( 28, flagsToBC )
0 JPnn, ( 2b, doesWord )
NOP, NOP, ( 2e, unused )
RAMSTART 0x51 + JPnn, ( RST 30 )
RAMSTART 0x4e + JPnn, ( RST 30 )
NOP, NOP, NOP, ( unused )
NOP, NOP, ( unused )
RAMSTART 0x51 + JPnn, ( RST 38 )
RAMSTART 0x4e + JPnn, ( RST 38 )
NOP, ( unused )
( BOOT DICT

View File

@ -5,8 +5,10 @@
: LIT 34 , ;
: LITS LIT SCPY ;
: LIT< WORD LITS ; IMMEDIATE
: _err LIT< word-not-found (print) ABORT ;
: ' WORD (find) NOT (?br) [ 4 , ] _err ;
: '
WORD (find) (?br) [ 4 , ] EXIT
LIT< (wnf) (find) DROP EXECUTE
;
: ['] ' LITN ; IMMEDIATE
: COMPILE ' LITN ['] , , ; IMMEDIATE
: [COMPILE] ' , ; IMMEDIATE
@ -117,6 +119,16 @@
own address )
46 RAM+ DUP 2 + SWAP !
: (print)
BEGIN
DUP C@ ( a c )
( exit if null )
DUP NOT IF 2DROP EXIT THEN
EMIT ( a )
1 + ( a+1 )
AGAIN
;
: ."
LIT
BEGIN
@ -129,3 +141,6 @@
; IMMEDIATE
: ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE
: (uflw) ABORT" stack underflow" ;
: (wnf) ABORT" word not found" ;

View File

@ -114,22 +114,6 @@
_c (parsed) _c NOT IF _c ABORT THEN
;
( a -- )
: (print)
BEGIN
_c DUP ( a a )
_c C@ ( a c )
( exit if null )
_c DUP _c NOT IF _c 2DROP EXIT THEN
_c EMIT ( a )
1 _c + ( a+1 )
AGAIN
;
: (uflw)
LIT< stack-underflow _c (print) _c ABORT
;
: C<
( 0c == CINPTR )
0x0c _c RAM+ _c @ EXECUTE