Moved dump into utils

This commit is contained in:
Brad Nelson
2021-02-12 20:58:32 -08:00
parent 364505ed73
commit 8fffafa018
2 changed files with 5 additions and 5 deletions

View File

@ -211,12 +211,8 @@ variable hld
swap dup line-width > if drop 0 cr then over >name nip + 1+ swap ;
: words 0 context @ @ begin dup while onlines dup see. >link repeat 2drop cr ;
( Examine Memory )
: dump ( a n -- )
cr 0 do i 16 mod 0= if cr then dup i + c@ . loop drop cr ;
: raw.s depth 0 max for aft sp@ r@ cells - @ . then next ;
( Input )
: raw.s depth 0 max for aft sp@ r@ cells - @ . then next ;
variable echo -1 echo !
: ?echo ( n -- ) echo @ if emit else drop then ;
: ?echo-prompt echo @ if >r >r raw.s r> r> ." --> " then ;

View File

@ -3,6 +3,10 @@
( For tests and asserts )
: assert ( f -- ) 0= throw ;
( Examine Memory )
: dump ( a n -- )
cr 0 do i 16 mod 0= if cr then dup i + c@ . loop drop cr ;
internals definitions
: mem= ( a a n -- f)
for aft 2dup c@ swap c@ <> if 2drop rdrop 0 exit then 1+ swap 1+ then next 2drop -1 ;