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 == C, 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