--- gforth/stuff.fs 2003/03/22 10:04:07 1.32 +++ gforth/stuff.fs 2004/06/13 17:04:29 1.34 @@ -110,7 +110,7 @@ AUser CSP ; immediate \ !! rewrite slurp-file using slurp-fid -: slurp-file ( c-addr1 u1 -- c-addr2 u2 ) +: slurp-file ( c-addr1 u1 -- c-addr2 u2 ) \ gforth \G @var{c-addr1 u1} is the filename, @var{c-addr2 u2} is the file's contents r/o bin open-file throw >r r@ file-size throw abort" file too large" @@ -118,7 +118,7 @@ AUser CSP 2dup r@ read-file throw over <> abort" could not read whole file" r> close-file throw ; -: slurp-fid { fid -- addr u } +: slurp-fid { fid -- addr u } \ gforth \G @var{addr u} is the content of the file @var{fid} 0 0 begin ( awhole uwhole ) dup 1024 + dup >r extend-mem ( anew awhole uwhole R: unew ) @@ -275,3 +275,9 @@ AUser CSP 10e f* loop ; [then] + +: f.s ( -- ) \ gforth f-dot-s + \G Display the number of items on the floating-point stack, + \G followed by a list of the items; TOS is the right-most item. + ." <" fdepth 0 .r ." > " fdepth 0 max maxdepth-.s @ min dup 0 + ?DO dup i - 1- floats fp@ + f@ 16 5 11 f.rdp space LOOP drop ;