about summary refs log tree commit diff stats
path: root/subx/054string-equal.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-03-20 17:08:43 -0700
committerKartik Agaram <vc@akkartik.com>2019-03-20 17:33:42 -0700
commit4068f0ca5b3a380790794a986897815d8b6a45a8 (patch)
tree3549ac214d5f2dfe6321ec4bc81f45b8d79b925d /subx/054string-equal.subx
parent5c21976b5837484264b26557013e3b9264b4ee89 (diff)
downloadmu-4068f0ca5b3a380790794a986897815d8b6a45a8.tar.gz
5011
New convention: compare 'with' for asymmetric comparisons (greater or lesser
than), and compare 'and' for symmetric comparisons. Worth making this distinction
even though the opcodes are identical; when we compare 'with', the order
of operands is significant.
Diffstat (limited to 'subx/054string-equal.subx')
-rw-r--r--subx/054string-equal.subx4
1 files changed, 2 insertions, 2 deletions
diff --git a/subx/054string-equal.subx b/subx/054string-equal.subx
index e2df6019..d85ec33d 100644
--- a/subx/054string-equal.subx
+++ b/subx/054string-equal.subx
@@ -52,7 +52,7 @@ string-equal?:  # s : (address string), benchmark : (address string) -> EAX : bo
     8b/copy                         0/mod/indirect  6/rm32/ESI    .           .             .           2/r32/EDX   .               .                 # copy *ESI to EDX
 $string-equal?:lengths:
     # if (lens != benchmark->length) return false
-    39/compare                      0/mod/indirect  7/rm32/EDI    .           .             .           2/r32/EDX   .               .                 # compare *EDI with EDX
+    39/compare                      0/mod/indirect  7/rm32/EDI    .           .             .           2/r32/EDX   .               .                 # compare *EDI and EDX
     75/jump-if-not-equal  $string-equal?:false/disp8
     # currs/ESI = s->data
     81          0/subop/add         3/mod/direct    6/rm32/ESI    .           .             .           .           .               4/imm32           # add to ESI
@@ -71,7 +71,7 @@ $string-equal?:loop:
     # c2 = *currb
     8a/copy-byte                    0/mod/indirect  7/rm32/EDI    .           .             .           3/r32/BL    .               .                 # copy byte at *EDI to BL
     # if (c1 != c2) return false
-    39/compare                      3/mod/direct    0/rm32/EAX    .           .             .           3/r32/EBX   .               .                 # compare EAX with EBX
+    39/compare                      3/mod/direct    0/rm32/EAX    .           .             .           3/r32/EBX   .               .                 # compare EAX and EBX
     75/jump-if-not-equal  $string-equal?:false/disp8
     # ++i
     41/inc-ECX