From eec9549bdea2feb72120750e12763327640a3d1a Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 14 May 2020 14:26:56 -0400 Subject: [PATCH] Make rdln use system RAM --- blk/081 | 9 ++++----- blk/082 | 4 ++-- blk/426 | 7 +++---- blk/430 | 5 ++--- emul/forth.bin | Bin 5947 -> 5925 bytes 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/blk/081 b/blk/081 index ee68d54..83ee781 100644 --- a/blk/081 +++ b/blk/081 @@ -1,5 +1,5 @@ RAMSTART FUTURE USES +55 (key) override -+02 CURRENT +57 readln's variables ++02 CURRENT +57 FUTURE USES +04 HERE +59 blk's variables +06 C ++32 IN(* ++34 FUTURE USES +4e INTJUMP +51 CURRENTPTR +53 (emit) override - - - (cont.) diff --git a/blk/082 b/blk/082 index a3cbc48..e02d3f3 100644 --- a/blk/082 +++ b/blk/082 @@ -9,8 +9,8 @@ PARSEPTR holds routine address called on (parse) C<* holds routine address called on C<. If the C<* override at 0x08 is nonzero, this routine is called instead. +IN> is the current position in IN(, which is the input buffer. - - +IN(* is a pointer to the input buffer, allocated at runtime. (cont.) diff --git a/blk/426 b/blk/426 index 5e25854..286d6d6 100644 --- a/blk/426 +++ b/blk/426 @@ -1,10 +1,9 @@ -: RDLNMEM+ 0x57 RAM+ @ + ; ( current position in INBUF ) -: IN> 0 RDLNMEM+ ; +: IN> 0x30 RAM+ ; ( points to INBUF ) -: IN( 2 RDLNMEM+ ; +: IN( 0x32 RAM+ @ ; ( points to INBUF's end ) -: IN) 0x40 ( buffer size ) 2+ RDLNMEM+ ; +: IN) 0x40 ( buffer size ) IN( + ; ( flush input buffer ) ( set IN> to IN( and set IN> @ to null ) diff --git a/blk/430 b/blk/430 index 866332d..498ec64 100644 --- a/blk/430 +++ b/blk/430 @@ -1,10 +1,9 @@ ( Initializes the readln subsystem ) : RDLN$ - ( 57 == rdln's memory ) - H@ 0x57 RAM+ ! + H@ 0x32 ( IN(* ) RAM+ ! ( plus 2 for extra bytes after buffer: 1 for the last typed 0x0a and one for the following NULL. ) - IN) IN> - 2+ ALLOT + IN) IN( - ALLOT (infl) ['] RDLN< 0x0c RAM+ ! 1 0x06 RAM+ ! ( 06 == CUb?3uH3%P}mgJB`mDkP?aM6oYiw3CQFK%6LAg{0tCTwMDJ zL5MBd2w|<>YXm(T&b&lNLEpz0jf zpb&5&S4>3wHjQmdm4c)D!WMYUMj>%oJ*zkjf_j&Fj4EYTQ)?6bi&QR95gt>!B4@B^@|>JK_Xg+=wrx8qY8&v zkl{hFl`h4Fu1_mf=N7>oHf9_G!0>nc_p5tMVqG}gDHJzj5b!s9R;h9h5tzhDRMjYp zcY`P8$u(TWV{tVZ?yxwt4USH!_9;i8e7TTHuL{lFR>p?dGdY^pp6!jCNP9!10popkThe*wA2pSrKk|DkCLh6`L1aXsSl zvOcxgrK--r2NYqW-=A=U3XlWhlBG%Td07t%k*lBqexgHF055fy-|1{toLI*=mnM`U zNrk#J0k;U$ync@`@Oza5>C7De*4Jds;0p$mrunYXH{T5gfiY{F+p+S*$Z(*rxtgm) zafde&m;3OETjZkI$cVRMap{KlVjCV{Jgdzu^Gw>~SLU^ZFe@(|^O`k}Z^yd$1N;_a Ar2qf`