diff options
| -rw-r--r-- | transform.e | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/transform.e b/transform.e index 3a6e34c..e4acd08 100644 --- a/transform.e +++ b/transform.e @@ -2610,15 +2610,17 @@ allocate-transformation-state s" transformation-state" variable ~ entry structures, as follows: ~ ~ (header start) -~ 0x00 - 0x07 Label-loop buffer length +~ 0x00 - 0x07 Label-loop buffer start +~ 0x08 - 0x0f Label-loop buffer length ~ (entry start) ~ ... + 0x00 - ... + 0x07 Data pointer ~ ... + 0x08 - ... + 0x0f Referenced data length ~ ... + 0x10 - ... + 0x17 String pointer ~ (entry fields repeat at successive offsets) ~ ... + 0x00 - ... + 0x07 (end) Zero, used as a delimiter -: hex-output-metadata-label-loop-buffer-length ; -: hex-output-metadata-first-entry 8 + ; +: hex-output-metadata-label-loop-buffer-start ; +: hex-output-metadata-label-loop-buffer-length 8 + ; +: hex-output-metadata-first-entry 2 8 * + ; : hex-output-metadata-entry-data-start ; : hex-output-metadata-entry-data-length 8 + ; : hex-output-metadata-entry-string 2 8 * + ; @@ -2981,36 +2983,39 @@ allocate-transformation-state s" transformation-state" variable ~ (size -- pointer) : hex-allocate-replacement dup allocate swap + ~ (result pointer, size) transformation-state transformation-state-output-metadata @ - swap pack64 + ~ (result pointer, size, metadata pointer) + 2 pick pack64 ~ Label buffer start + swap pack64 ~ Label buffer length ~ (result pointer, metadata output point) - over pack64 - 0 pack64 + over pack64 ~ Entry data start + 0 pack64 ~ Entry data length s" This is a commented hexadecimal representation of a compiled program," - pack64 + pack64 ~ Entry string - over pack64 - 0 pack64 + over pack64 ~ Entry data start + 0 pack64 ~ Entry data length s" the output of Evocation's hex transform. The comments are intended to" - pack64 + pack64 ~ Entry string - over pack64 - 0 pack64 + over pack64 ~ Entry data start + 0 pack64 ~ Entry data length s" allow a human reader to audit it. The difference between a source and a " - pack64 + pack64 ~ Entry string - over pack64 - 0 pack64 + over pack64 ~ Entry data start + 0 pack64 ~ Entry data length s" binary is comments! Enjoy. :)" - pack64 + pack64 ~ Entry string - over pack64 - 0 pack64 - s" " pack64 + over pack64 ~ Entry data start + 0 pack64 ~ Entry data length + s" " pack64 ~ Entry string - 0 pack64 + 0 pack64 ~ End-of-entries delimiter drop ; ~ ... then, we define the alternate. @@ -3292,7 +3297,8 @@ allocate-transformation-state s" transformation-state" variable ~ Initialize the contents of the output metadata. See the notes above ~ hex-output-metadata-* for details on its format. transformation-state transformation-state-output-metadata @ - 0 pack64 ~ Output buffer length + 0 pack64 ~ Label buffer start + 0 pack64 ~ Label buffer length 0 pack64 ~ End-of-entries delimiter drop |