summary refs log tree commit diff
path: root/dynamic.e
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic.e')
-rw-r--r--dynamic.e30
1 files changed, 25 insertions, 5 deletions
diff --git a/dynamic.e b/dynamic.e
index 79944b2..a02eec0 100644
--- a/dynamic.e
+++ b/dynamic.e
@@ -135,9 +135,9 @@
   stringlen 1+ 54 swap - 0 max indent dup .hex64
   dup entry-flags@ dup
     { space
-      dup 128 & { s" H" emitstring } if
-      dup 64 & { s" M" emitstring } if
-      dup 1 & { s" I" emitstring } if
+      dup 0x80 & { s" H" emitstring } if
+      dup 0x40 & { s" M" emitstring } if
+      dup 0x01 & { s" I" emitstring } if
     } if drop
   dup is-assembly-word { s"  asm" emitstring }
     { dup is-docol-interpreted-word { s"  raw" emitstring } unless
@@ -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 ;
 
 
@@ -296,6 +315,7 @@
 : make-immediate latest @ dup entry-flags@ 0x01 | swap entry-flags! ;
 : make-hidden latest @ dup entry-flags@ 0x80 | swap entry-flags! ;
 : make-visible latest @ dup entry-flags@ 0x80 invert & swap entry-flags! ;
+: make-metadata latest @ dup entry-flags@ 0x40 | swap entry-flags! ;
 
 ~   Sooner or later we'll want to define recursive words; this one lets us
 ~ do that. It compiles into a call to the word that's currently being