From 8fffafa018a48f24ef043bffac874bc1c773e68b Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Fri, 12 Feb 2021 20:58:32 -0800 Subject: [PATCH] Moved dump into utils --- ueforth/common/boot.fs | 6 +----- ueforth/common/utils.fs | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ueforth/common/boot.fs b/ueforth/common/boot.fs index 69ab455..8ef1f3e 100644 --- a/ueforth/common/boot.fs +++ b/ueforth/common/boot.fs @@ -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 ; diff --git a/ueforth/common/utils.fs b/ueforth/common/utils.fs index 86b864e..8b842c0 100644 --- a/ueforth/common/utils.fs +++ b/ueforth/common/utils.fs @@ -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 ;