about summary refs log tree commit diff stats
path: root/067parse-hex.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-04-03 12:35:53 -0700
committerKartik Agaram <vc@akkartik.com>2020-04-03 12:35:53 -0700
commitbfcc0f858aa324739ad645e2056d73a47ab66f82 (patch)
tree24a22e364b2c1d535013c604b7a9620a31606e71 /067parse-hex.subx
parentf730f2f2c7934f52091a848b71f9031ea99e2377 (diff)
downloadmu-bfcc0f858aa324739ad645e2056d73a47ab66f82.tar.gz
6182 - start of support for safe handles
So far it's unclear how to do this in a series of small commits. Still
nibbling around the edges. In this commit we standardize some terminology:

The length of an array or stream is denominated in the high-level elements.
The _size_ is denominated in bytes.

The thing we encode into the type is always the size, not the length.

There's still an open question of what to do about the Mu `length` operator.
I'd like to modify it to provide the length. Currently it provides the
size. If I can't fix that I'll rename it.
Diffstat (limited to '067parse-hex.subx')
-rw-r--r--067parse-hex.subx6
1 files changed, 3 insertions, 3 deletions
diff --git a/067parse-hex.subx b/067parse-hex.subx
index 23270027..b5a5bacf 100644
--- a/067parse-hex.subx
+++ b/067parse-hex.subx
@@ -362,10 +362,10 @@ parse-hex-int:  # in: (addr array byte) -> result/eax: int
     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   8/disp8         .                 # copy *(ebp+8) to eax
     # var curr/ecx: (addr byte) = &in->data
     8d/copy-address                 1/mod/*+disp8   0/rm32/eax    .           .             .           1/r32/ecx   4/disp8         .                 # copy eax+4 to ecx
-    # var max/edx: (addr byte) = &in->data[in->length]
-    # . edx = in->length
+    # var max/edx: (addr byte) = &in->data[in->size]
+    # . edx = in->size
     8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           2/r32/edx   .               .                 # copy *eax to edx
-    # . edx = in->data + in->length
+    # . edx = in->data + in->size
     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  2/index/edx   .           2/r32/edx   4/disp8         .                 # copy eax+edx+4 to edx
     # return parse-hex-int-helper(curr, max)
     # . . push args