about summary refs log tree commit diff stats
path: root/subx/052kernel-string-equal.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-01-06 12:51:49 -0800
committerKartik Agaram <vc@akkartik.com>2019-01-06 12:52:33 -0800
commitaff782c4293e0c471505743575a1a0683a7ed096 (patch)
tree1cd15a0d670764bba76e91731085ec922898ec74 /subx/052kernel-string-equal.subx
parent458ee5e354fa55e770696fb19054d4c6bb60ead6 (diff)
downloadmu-aff782c4293e0c471505743575a1a0683a7ed096.tar.gz
4911
Diffstat (limited to 'subx/052kernel-string-equal.subx')
-rw-r--r--subx/052kernel-string-equal.subx19
1 files changed, 9 insertions, 10 deletions
diff --git a/subx/052kernel-string-equal.subx b/subx/052kernel-string-equal.subx
index 67e9695e..5ee7d5ef 100644
--- a/subx/052kernel-string-equal.subx
+++ b/subx/052kernel-string-equal.subx
@@ -29,16 +29,6 @@
 # compare a null-terminated ascii string with a more idiomatic length-prefixed byte array
 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args
 kernel-string-equal:  # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean
-    # . prolog
-    55/push-EBP
-    89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # . save registers
-    51/push-ECX
-    52/push-EDX
-    53/push-EBX
-    56/push-ESI
-    57/push-EDI
-
     # pseudocode:
     #   initialize n = b->length
     #   initialize s1 = s
@@ -53,6 +43,15 @@ kernel-string-equal:  # s : null-terminated ascii string, benchmark : length-pre
     #       return false
     #   return *s1 == 0
     #
+    # . prolog
+    55/push-EBP
+    89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
+    # . save registers
+    51/push-ECX
+    52/push-EDX
+    53/push-EBX
+    56/push-ESI
+    57/push-EDI
     # initialize s into EDI
     8b/copy                         1/mod/*+disp8   5/rm32/EBP    .           .             .           7/r32/EDI   8/disp8         .                 # copy *(EBP+8) to EDI
     # initialize benchmark length n into EDX