Moved dump into utils
This commit is contained in:
@ -211,12 +211,8 @@ variable hld
|
|||||||
swap dup line-width > if drop 0 cr then over >name nip + 1+ swap ;
|
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 ;
|
: 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 )
|
( Input )
|
||||||
|
: raw.s depth 0 max for aft sp@ r@ cells - @ . then next ;
|
||||||
variable echo -1 echo !
|
variable echo -1 echo !
|
||||||
: ?echo ( n -- ) echo @ if emit else drop then ;
|
: ?echo ( n -- ) echo @ if emit else drop then ;
|
||||||
: ?echo-prompt echo @ if >r >r raw.s r> r> ." --> " then ;
|
: ?echo-prompt echo @ if >r >r raw.s r> r> ." --> " then ;
|
||||||
|
|||||||
@ -3,6 +3,10 @@
|
|||||||
( For tests and asserts )
|
( For tests and asserts )
|
||||||
: assert ( f -- ) 0= throw ;
|
: 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
|
internals definitions
|
||||||
: mem= ( a a n -- f)
|
: mem= ( a a n -- f)
|
||||||
for aft 2dup c@ swap c@ <> if 2drop rdrop 0 exit then 1+ swap 1+ then next 2drop -1 ;
|
for aft 2dup c@ swap c@ <> if 2drop rdrop 0 exit then 1+ swap 1+ then next 2drop -1 ;
|
||||||
|
|||||||
Reference in New Issue
Block a user