From d1cccb7b2096f9b4418487f1d2a605c0b157441a Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 11 Jun 2026 19:25:38 -0700 Subject: add ascii to the hexdumps yay! that helps a lot (as tempting as it was to keep doing it mentally forever...) Force-Push: yes Change-Id: I7a213bc46913d00f9a9d3f49bcb22bfed248a010 --- dynamic.e | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'dynamic.e') diff --git a/dynamic.e b/dynamic.e index f99f0ec..a02eec0 100644 --- a/dynamic.e +++ b/dynamic.e @@ -150,14 +150,33 @@ { dup word-heading next-newer-entry } while drop ; +~ (byte -- boolean) +: is-printable + dup 0x20 <= swap 0x7F > && ; + + ~ (content end, content start, label start --) : hexdump-row 2 indent dup .hex32 dup 4 unroll - 0 { dup 16 > } - { dup 7 & 0 = { space } if space + ~ (label start, content end, content start, label start) + 0 { dup 16 > } { + ~ (label start, content end, content start, label start, offset within row) + dup 7 & 0 = { space } if space 2dup + dup 4 pick <= swap 5 pick > && { 2dup + 8@ .hex8 } { space space } if-else 1+ } while + drop + 2 indent s" |" emitstring + 0 { dup 16 > } { + ~ (label start, content end, content start, label start, offset within row) + 2dup + dup 4 pick <= swap 5 pick > && + { 2dup + 8@ + dup is-printable + { value@ emitstring } { s" ." emitstring } if-else + drop } + { space } if-else + 1+ } while + s" |" emitstring newline 5 ndrop ; -- cgit 1.4.1