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, ( 28, flagsToBC )
0 JPnn, ( 2b, doesWord ) 0 JPnn, ( 2b, doesWord )
NOP, NOP, ( 2e, unused ) NOP, NOP, ( 2e, unused )
RAMSTART 0x51 + JPnn, ( RST 30 ) RAMSTART 0x4e + JPnn, ( RST 30 )
NOP, NOP, NOP, ( unused ) NOP, NOP, NOP, ( unused )
NOP, NOP, ( unused ) NOP, NOP, ( unused )
RAMSTART 0x51 + JPnn, ( RST 38 ) RAMSTART 0x4e + JPnn, ( RST 38 )
NOP, ( unused ) NOP, ( unused )
( BOOT DICT ( BOOT DICT

View File

@ -5,8 +5,10 @@
: LIT 34 , ; : LIT 34 , ;
: LITS LIT SCPY ; : LITS LIT SCPY ;
: LIT< WORD LITS ; IMMEDIATE : 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 : ['] ' LITN ; IMMEDIATE
: COMPILE ' LITN ['] , , ; IMMEDIATE : COMPILE ' LITN ['] , , ; IMMEDIATE
: [COMPILE] ' , ; IMMEDIATE : [COMPILE] ' , ; IMMEDIATE
@ -117,6 +119,16 @@
own address ) own address )
46 RAM+ DUP 2 + SWAP ! 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 LIT
BEGIN BEGIN
@ -129,3 +141,6 @@
; IMMEDIATE ; IMMEDIATE
: ABORT" [COMPILE] ." COMPILE ABORT ; 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 _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< : C<
( 0c == CINPTR ) ( 0c == CINPTR )
0x0c _c RAM+ _c @ EXECUTE 0x0c _c RAM+ _c @ EXECUTE