From 389b23fe1a2964ae315fe392e188033941258b81 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 25 Apr 2020 09:10:25 -0400 Subject: [PATCH] Change C 2236 bytes forth/blk.fs | 8 ++++++-- forth/readln.fs | 21 ++++++++++++--------- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/blk/083 b/blk/083 index 881a691..751f77a 100644 --- a/blk/083 +++ b/blk/083 @@ -1,5 +1,6 @@ -C IF EXECUTE THEN ( 06 == ClxJPh92pg*tgR>3qpW?g@vEFo@Ex}6_)=@+ZmTJf%w0Hco|b2 z+cY)^??00hgGOpzNl~Sy1p_TmpCk9Wy5Z9o9AlDE922Q@mlP9nr5^ewr`*?=< z6##8fU{GMFW2>8-%Aw?3$F_)hHKP-Q6(0j5UoJbyLDSeCvvISgGl((FVoc^pXW(F{ gVhmt^fc4 delta 213 zcmdlZcuH_X2%GRMMg;~YhD_FU1{Q`YMkfYm8|lfBY`LtNY_k~mPCm^h&wH8eB;$Xk z0v3qKcQ#qZC6h(jRT!lwTd_;)_OLBsyTZcH{F~)JlM{nRYFh9f|0s~BTBf*Ef8cVdV) HVPFIRj`=jl diff --git a/forth/blk.fs b/forth/blk.fs index 6ad8bae..365b98e 100644 --- a/forth/blk.fs +++ b/forth/blk.fs @@ -61,17 +61,21 @@ ; : LOAD - ( save BLK>, C<* override and boot< ptr to RSP ) + ( save restorable variables to RSP ) BLK> @ >R 0x08 RAM+ @ >R - 0x2e RAM+ @ >R + 0x06 RAM+ @ >R ( CR ( boot ptr ) BLK@ ( Point to beginning of BLK ) BLK( 0x2e RAM+ ! ( 08 == C<* override ) ['] _ 0x08 RAM+ ! + ( While we interpret, don't print "ok" after every word ) + 1 0x06 RAM+ ! ( 06 == C 0x2e RAM+ ! + R> 0x06 RAM+ ! ( Before we restore C<* are we restoring it to "_"? if yes, it means we're in a nested LOAD which means we should also load back the saved BLK>. Otherwise, we can diff --git a/forth/readln.fs b/forth/readln.fs index 3822b57..a10a1ed 100644 --- a/forth/readln.fs +++ b/forth/readln.fs @@ -59,15 +59,18 @@ LF IN( IN> ! ; -: RDLN @ C@ ; - -( And finally, implement a replacement for the (c<) routine ) +( And finally, implement C<* ) : RDLN< - RDLN +! EXIT THEN ( c ) - ( EOL ? readline. we still return typed char though ) - (rdln) ( c ) + IN> @ C@ + DUP IF + ( not EOL? good, inc and return ) + 1 IN> +! + ELSE + ( EOL ? readline. we still return null though ) + (rdln) + THEN + ( update C @ C@ 0 > 0x06 RAM+ ! ( 06 == C