about summary refs log tree commit diff
path: root/core.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-09-15 18:00:31 -0700
committerIrene Knapp <ireneista@irenes.space>2026-09-15 18:00:31 -0700
commite1f5c4e72830cc9ce900e1884d3338f1c82060fd (patch)
tree5e7378c0fc9dc934a0592389c169ef9c0ca25a46 /core.e
parent9ac5b1f59144c13d2bdb1508f4e4f820db00bf48 (diff)
redo the hex dump comments for alignment to use the regular magic commands
previously, alignment had been a special-cased type of metadata entry, with a special trap on packalign. now it uses the same programmable setup everything else does. much simpler, and prettier output.

this CL also contains some modest reformatting of section headers in the hex dump

Force-Push: yes
Change-Id: I21554e92f6af6ddefa937dad8073b89657f85d64
Diffstat (limited to 'core.e')
-rw-r--r--core.e8
1 files changed, 7 insertions, 1 deletions
diff --git a/core.e b/core.e
index 44f9fd5..e181d4f 100644
--- a/core.e
+++ b/core.e
@@ -1219,8 +1219,14 @@ here !
 
 ~ (output point, alignment byte width -- output point)
 : packalign
+  ~   It's possible the padding will be of length zero, so we have to put the
+  ~ magic comment provide-* command first.
+  ~ : provide-decimal
+  ~ : 0 Alignment padding to width #
   { 2dup /% drop { drop exit } unless
-    swap 0 pack8 swap } forever ;
+    swap 0 pack8 swap
+    ~ : 1 adjust-length
+  } forever ;
 
 
 ~ Binary unpacking