about summary refs log tree commit diff stats
path: root/examples/ex10.subx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ex10.subx')
-rw-r--r--examples/ex10.subx9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/ex10.subx b/examples/ex10.subx
index c32c44ea..36a21bbe 100644
--- a/examples/ex10.subx
+++ b/examples/ex10.subx
@@ -7,7 +7,7 @@
 #   $ echo $?
 #   0  # false
 
-== code 0x09000000
+== code
 #   instruction                     effective address                                                   register    displacement    immediate
 # . op          subop               mod             rm32          base        index         scale       r32
 # . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
@@ -27,10 +27,9 @@ Entry:  # return argv-equal(argv[1], argv[2])
     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
     # . . call
     e8/call argv-equal/disp32
-    # syscall(exit, eax)
+    # exit(eax)
     89/copy                         3/mod/direct    3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # copy eax to ebx
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # compare two null-terminated ascii strings
 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args
@@ -67,6 +66,4 @@ $argv-equal:false:
     b8/copy-to-eax  0/imm32
     c3/return
 
-== data 0x0a000000
-
 # . . vim:nowrap:textwidth=0