about summary refs log tree commit diff stats
path: root/subx/examples/ex10.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-11-30 16:45:15 -0800
committerKartik Agaram <vc@akkartik.com>2018-11-30 16:45:15 -0800
commit9d27e966b5e9bf1bd3da48f49d7e133d112a2bbe (patch)
tree31880fb6a0f7a125ccba2beb03f8d1ac51577380 /subx/examples/ex10.subx
parent4cb6970d9d96d0adca78212f5f9b584499e37bb0 (diff)
downloadmu-9d27e966b5e9bf1bd3da48f49d7e133d112a2bbe.tar.gz
4808 - clean up comments in all subx files
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