about summary refs log tree commit diff stats
path: root/subx/examples/ex10.subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx/examples/ex10.subx')
-rw-r--r--subx/examples/ex10.subx11
1 files changed, 5 insertions, 6 deletions
diff --git a/subx/examples/ex10.subx b/subx/examples/ex10.subx
index 936edb08..69e7c2ec 100644
--- a/subx/examples/ex10.subx
+++ b/subx/examples/ex10.subx
@@ -1,4 +1,4 @@
-## String comparison: return 1 iff the two args passed in at the commandline are equal.
+# String comparison: return 1 iff the two args passed in at the commandline are equal.
 #
 # To run (from the subx directory):
 #   $ subx translate examples/ex10.subx -o examples/ex10
@@ -20,15 +20,14 @@
 #         ...
     # . prolog
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # . . call argv-equal(argv[1], argv[2])
-    # push argv[2]
+    # argv-equal(argv[1], argv[2])
+    # . . push argv[2]
     ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           0xc/disp8       .                 # push *(EBP+12)
-    # push argv[1]
+    # . . push argv[1]
     ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           0x8/disp8       .                 # push *(EBP+8)
     # . . call
     e8/call argv-equal/disp32
-    # exit(EAX)
-$exit:
+    # syscall(exit, EAX)
     89/copy                         3/mod/direct    3/rm32/EBX    .           .             .           0/r32/EAX   .               .                 # copy EAX to EBX
     b8/copy-to-EAX  1/imm32
     cd/syscall  0x80/imm8