about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-10 23:09:30 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-10 23:09:30 -0700
commit7dac9ade153d736b7a183d073d83b7a17b22b4cc (patch)
treef19ba4be87306ae53caa0ba8c61e5202899cee48 /apps
parent72d893b6b1c0dcaea5c4a38dd6fd83fd0569dd79 (diff)
downloadmu-7dac9ade153d736b7a183d073d83b7a17b22b4cc.tar.gz
6507 - use syscall names everywhere
Diffstat (limited to 'apps')
-rwxr-xr-xapps/assortbin44283 -> 44225 bytes
-rw-r--r--apps/assort.subx3
-rwxr-xr-xapps/bracesbin46154 -> 46088 bytes
-rw-r--r--apps/braces.subx3
-rwxr-xr-xapps/callsbin50815 -> 50735 bytes
-rw-r--r--apps/calls.subx24
-rwxr-xr-xapps/crenshaw2-1bin43634 -> 43576 bytes
-rw-r--r--apps/crenshaw2-1.subx3
-rwxr-xr-xapps/crenshaw2-1bbin44181 -> 44123 bytes
-rw-r--r--apps/crenshaw2-1b.subx3
-rwxr-xr-xapps/dquotesbin47905 -> 47847 bytes
-rw-r--r--apps/dquotes.subx3
-rwxr-xr-xapps/ex5bin246 -> 244 bytes
-rw-r--r--apps/ex5.subx3
-rwxr-xr-xapps/factorialbin42727 -> 42669 bytes
-rw-r--r--apps/factorial.subx3
-rw-r--r--apps/factorial2.subx3
-rw-r--r--apps/factorial3.subx3
-rw-r--r--apps/factorial4.subx3
-rwxr-xr-xapps/hexbin46473 -> 46415 bytes
-rw-r--r--apps/hex.subx3
-rwxr-xr-xapps/mubin270544 -> 270430 bytes
-rw-r--r--apps/mu.subx75
-rw-r--r--apps/mulisp.subx3
-rwxr-xr-xapps/packbin56598 -> 56540 bytes
-rw-r--r--apps/pack.subx3
-rw-r--r--apps/random.subx9
-rwxr-xr-xapps/sigilsbin58539 -> 58457 bytes
-rw-r--r--apps/sigils.subx27
-rwxr-xr-xapps/surveybin54229 -> 54157 bytes
-rw-r--r--apps/survey.subx24
-rwxr-xr-xapps/testsbin43055 -> 42997 bytes
-rw-r--r--apps/tests.subx3
33 files changed, 67 insertions, 134 deletions
diff --git a/apps/assort b/apps/assort
index 7cbf2e7a..4531e654 100755
--- a/apps/assort
+++ b/apps/assort
Binary files differdiff --git a/apps/assort.subx b/apps/assort.subx
index c02ae69b..fa33fcc7 100644
--- a/apps/assort.subx
+++ b/apps/assort.subx
@@ -79,8 +79,7 @@ $subx-assort-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-assort-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # data structure:
 #   table: (addr stream {(handle array byte), (handle stream byte)})     (16 bytes/row)
diff --git a/apps/braces b/apps/braces
index 864662ef..6fc70561 100755
--- a/apps/braces
+++ b/apps/braces
Binary files differdiff --git a/apps/braces.subx b/apps/braces.subx
index 789037e7..a3d1e30e 100644
--- a/apps/braces.subx
+++ b/apps/braces.subx
@@ -72,8 +72,7 @@ $subx-braces-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx 0/imm32
 $subx-braces-main:end:
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
 
 subx-braces:  # in: (addr buffered-file), out: (addr buffered-file)
     # pseudocode:
diff --git a/apps/calls b/apps/calls
index e4c185ed..a4f41796 100755
--- a/apps/calls
+++ b/apps/calls
Binary files differdiff --git a/apps/calls.subx b/apps/calls.subx
index d579ace8..e0ec7dc8 100644
--- a/apps/calls.subx
+++ b/apps/calls.subx
@@ -72,8 +72,7 @@ $subx-calls-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx 0/imm32
 $subx-calls-main:end:
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
 
 subx-calls:  # in: (addr buffered-file), out: (addr buffered-file)
     # pseudocode:
@@ -536,8 +535,7 @@ $emit-call:error1:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 test-subx-calls-passes-most-lines-through:
@@ -1020,8 +1018,7 @@ $next-word-string-or-expression-without-metadata:error0:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $next-word-string-or-expression-without-metadata:error1:
@@ -1059,8 +1056,7 @@ $next-word-string-or-expression-without-metadata:error1:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $next-word-string-or-expression-without-metadata:error2:
@@ -1098,8 +1094,7 @@ $next-word-string-or-expression-without-metadata:error2:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $next-word-string-or-expression-without-metadata:error3:
@@ -1137,8 +1132,7 @@ $next-word-string-or-expression-without-metadata:error3:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $next-word-string-or-expression-without-metadata:error4:
@@ -1176,8 +1170,7 @@ $next-word-string-or-expression-without-metadata:error4:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $next-word-string-or-expression-without-metadata:error5:
@@ -1215,8 +1208,7 @@ $next-word-string-or-expression-without-metadata:error5:
     81 0/subop/add %esp 4/imm32
     # . syscall(exit, 1)
     bb/copy-to-ebx 1/imm32
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 test-next-word-string-or-expression-without-metadata:
diff --git a/apps/crenshaw2-1 b/apps/crenshaw2-1
index 0791f0c4..842de58d 100755
--- a/apps/crenshaw2-1
+++ b/apps/crenshaw2-1
Binary files differdiff --git a/apps/crenshaw2-1.subx b/apps/crenshaw2-1.subx
index 8e20342b..60c1ed5b 100644
--- a/apps/crenshaw2-1.subx
+++ b/apps/crenshaw2-1.subx
@@ -86,8 +86,7 @@ $run-main:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # the main entry point
 compile:  # in: (addr buffered-file), out: fd or (addr stream byte), err: fd or (addr stream byte), ed: (addr exit-descriptor)
diff --git a/apps/crenshaw2-1b b/apps/crenshaw2-1b
index 3b5d0bef..545911df 100755
--- a/apps/crenshaw2-1b
+++ b/apps/crenshaw2-1b
Binary files differdiff --git a/apps/crenshaw2-1b.subx b/apps/crenshaw2-1b.subx
index 62e56312..289f91e2 100644
--- a/apps/crenshaw2-1b.subx
+++ b/apps/crenshaw2-1b.subx
@@ -86,8 +86,7 @@ $run-main:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # the main entry point
 compile:  # in: (addr buffered-file), out: fd or (addr stream byte), err: fd or (addr stream byte), ed: (addr exit-descriptor)
diff --git a/apps/dquotes b/apps/dquotes
index a9ba6ab5..5ae175b8 100755
--- a/apps/dquotes
+++ b/apps/dquotes
Binary files differdiff --git a/apps/dquotes.subx b/apps/dquotes.subx
index 4abeeae5..ba8d3ee0 100644
--- a/apps/dquotes.subx
+++ b/apps/dquotes.subx
@@ -75,8 +75,7 @@ $subx-dquotes-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-dquotes-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # conceptual hierarchy within a line:
 #   line = words separated by ' ', maybe followed by comment starting with '#'
diff --git a/apps/ex5 b/apps/ex5
index a3c4f494..90ad3a52 100755
--- a/apps/ex5
+++ b/apps/ex5
Binary files differdiff --git a/apps/ex5.subx b/apps/ex5.subx
index 6e9c6a5a..a2b0eeba 100644
--- a/apps/ex5.subx
+++ b/apps/ex5.subx
@@ -32,8 +32,7 @@ Entry:
     # . size = 1 character
     ba/copy-to-edx  1/imm32
     # . syscall
-    b8/copy-to-eax  4/imm32/write
-    cd/syscall  0x80/imm8
+    e8/call  syscall_write/disp32
 
     # exit(ebx)
     e8/call  syscall_exit/disp32
diff --git a/apps/factorial b/apps/factorial
index 8d73facb..df1bb158 100755
--- a/apps/factorial
+++ b/apps/factorial
Binary files differdiff --git a/apps/factorial.subx b/apps/factorial.subx
index bded3a36..d5882887 100644
--- a/apps/factorial.subx
+++ b/apps/factorial.subx
@@ -95,8 +95,7 @@ $run-main:
     # syscall(exit, eax)
     89/copy                         3/mod/direct    3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # copy eax to ebx
 $main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 factorial:  # n: int -> int/eax
     # . prologue
diff --git a/apps/factorial2.subx b/apps/factorial2.subx
index a3bcb079..0eaaf049 100644
--- a/apps/factorial2.subx
+++ b/apps/factorial2.subx
@@ -65,8 +65,7 @@ $run-main:
     # syscall(exit, eax)
     89/<- %ebx 0/r32/eax
 $main:end:
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call  syscall_exit/disp32
 
 factorial:  # n: int -> int/eax
     # . prologue
diff --git a/apps/factorial3.subx b/apps/factorial3.subx
index d97eb6e2..e8f39066 100644
--- a/apps/factorial3.subx
+++ b/apps/factorial3.subx
@@ -46,8 +46,7 @@ $run-main:
     # syscall(exit, eax)
     89/<- %ebx 0/r32/eax
 $main:end:
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call  syscall_exit/disp32
 
 factorial:  # n: int -> int/eax
     # . prologue
diff --git a/apps/factorial4.subx b/apps/factorial4.subx
index 3aae0dd3..3028999e 100644
--- a/apps/factorial4.subx
+++ b/apps/factorial4.subx
@@ -52,8 +52,7 @@ Entry:  # run tests if necessary, compute `factorial(5)` if not
       89/<- %ebx 0/r32/eax
     }
 
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call  syscall_exit/disp32
 
 factorial:  # n: int -> int/eax
     # . prologue
diff --git a/apps/hex b/apps/hex
index 806481f0..fd3ae016 100755
--- a/apps/hex
+++ b/apps/hex
Binary files differdiff --git a/apps/hex.subx b/apps/hex.subx
index 0fa9f485..5dc8c023 100644
--- a/apps/hex.subx
+++ b/apps/hex.subx
@@ -73,8 +73,7 @@ $subx-hex-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-hex-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # the main entry point
 subx-hex:  # in: (addr buffered-file), out: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor)
diff --git a/apps/mu b/apps/mu
index 086f9c9d..dd1e624a 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/mu.subx b/apps/mu.subx
index 6a87962f..f469f463 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -473,8 +473,7 @@ Entry:
     # syscall(exit, 0)
     bb/copy-to-ebx 0/imm32
 $mu-main:end:
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call syscall_exit/disp32
 
 convert-mu:  # in: (addr buffered-file), out: (addr buffered-file)
     # . prologue
@@ -3986,8 +3985,7 @@ $parse-mu:error1:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $parse-mu:error2:
@@ -3999,8 +3997,7 @@ $parse-mu:error2:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 # scenarios considered:
@@ -4169,8 +4166,7 @@ $populate-mu-function-header:error1:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $populate-mu-function-header:error2:
@@ -4181,8 +4177,7 @@ $populate-mu-function-header:error2:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $populate-mu-function-header:error3:
@@ -4199,8 +4194,7 @@ $populate-mu-function-header:error3:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 test-function-header-with-arg:
@@ -4518,8 +4512,7 @@ $parse-var-with-type:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 parse-type:  # ad: (addr allocation-descriptor), in: (addr stream byte), out: (addr handle tree type-id)
@@ -4637,8 +4630,7 @@ $parse-type:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 parse-type-tree:  # ad: (addr allocation-descriptor), in: (addr stream byte), out: (addr handle tree type-id)
@@ -5698,8 +5690,7 @@ $parse-mu-block:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 new-block-name:  # fn: (addr function), out: (addr handle var)
@@ -5807,8 +5798,7 @@ check-no-tokens-left:  # line: (addr stream byte)
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 $check-no-tokens-left:end:
     # . reclaim locals
@@ -5949,8 +5939,7 @@ $parse-mu-var-def:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 test-parse-mu-var-def:
@@ -6151,8 +6140,7 @@ $parse-mu-stmt:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 add-operation-and-inputs-to-stmt:  # stmt: (addr stmt), line: (addr stream byte), vars: (addr stack live-var)
@@ -6269,8 +6257,7 @@ $add-operation-and-inputs-to-stmt:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 stmt-has-outputs?:  # line: (addr stream byte) -> result/eax: boolean
@@ -6373,8 +6360,7 @@ $lookup-var-or-literal:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 # return first 'name' from the top (back) of 'vars' and abort if not found
@@ -6405,8 +6391,7 @@ $lookup-var:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 # return first 'name' from the top (back) of 'vars', and 0/null if not found
@@ -6489,8 +6474,7 @@ $lookup-var-helper:error1:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 # return first 'name' from the top (back) of 'vars' and create a new var for a fn output if not found
@@ -6769,8 +6753,7 @@ $new-literal-integer:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 new-literal:  # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var)
@@ -7482,8 +7465,7 @@ $populate-mu-type:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 type-name:  # index: int -> result/eax: (addr array byte)
@@ -7633,8 +7615,7 @@ $populate-mu-type-sizes-in-type:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 # Analogous to size-of, except we need to compute what size-of can just read
@@ -7831,8 +7812,7 @@ $locate-typeinfo-entry-with-index:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 dump-typeinfos:  # hdr: (addr array byte)
@@ -8669,8 +8649,7 @@ $push-output-and-maybe-emit-spill:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 emit-subx-cleanup-and-unconditional-nonlocal-branch:  # out: (addr buffered-file), stmt: (addr stmt1), vars: (addr stack live-var)
@@ -9762,8 +9741,7 @@ $translate-mu-index-stmt-with-array:error1:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 $translate-mu-index-stmt-with-array:error2:
@@ -9771,8 +9749,7 @@ $translate-mu-index-stmt-with-array:error2:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 translate-mu-index-stmt-with-array-in-register:  # out: (addr buffered-file), stmt: (addr stmt)
@@ -10176,8 +10153,7 @@ $power-of-2?:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 num-shift-rights:  # n: int -> result/eax: int
@@ -13217,8 +13193,7 @@ $get-stmt-operand-from-arg-location:abort:
     (flush Stderr)
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call syscall_exit/disp32
     # never gets here
 
 emit-subx-r32:  # out: (addr buffered-file), l: arg-location, stmt: (addr stmt)
diff --git a/apps/mulisp.subx b/apps/mulisp.subx
index 3c85ad52..b433fa17 100644
--- a/apps/mulisp.subx
+++ b/apps/mulisp.subx
@@ -33,8 +33,7 @@ Entry:  # run tests if necessary, a REPL if not
     # syscall(exit, 0)
     bb/copy-to-ebx 0/imm32
 $main:end:
-    b8/copy-to-eax 1/imm32/exit
-    cd/syscall 0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # Data structures
 #
diff --git a/apps/pack b/apps/pack
index 8f1996bd..ad0f2173 100755
--- a/apps/pack
+++ b/apps/pack
Binary files differdiff --git a/apps/pack.subx b/apps/pack.subx
index a72079a7..60133ba4 100644
--- a/apps/pack.subx
+++ b/apps/pack.subx
@@ -66,8 +66,7 @@ $subx-pack-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-pack-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # - big picture
 # We'll operate on each line/instruction in isolation. That way we only need to
diff --git a/apps/random.subx b/apps/random.subx
index 70eaffa2..3cc1caa2 100644
--- a/apps/random.subx
+++ b/apps/random.subx
@@ -14,8 +14,7 @@ Entry:
     bb/copy-to-ebx  Filename/imm32
     b9/copy-to-ecx  0/imm32/rdonly
     ba/copy-to-edx  0x180/imm32/fixed-perms
-    b8/copy-to-eax  5/imm32/open
-    cd/syscall  0x80/imm8
+    e8/call  syscall_open/disp32
     # . stream = eax
     89/copy                         3/mod/direct    6/rm32/esi    .           .             .           0/r32/eax   .               .                 # copy eax to esi
 
@@ -25,8 +24,7 @@ $loop:
     89/copy                         3/mod/direct    3/rm32/ebx    .           .             .           6/r32/esi   .               .                 # copy esi to ebx
     b9/copy-to-ecx  N/imm32
     ba/copy-to-edx  4/imm32/size
-    b8/copy-to-eax  3/imm32/read
-    cd/syscall  0x80/imm8
+    e8/call  syscall_read/disp32
 
     # print-int32-buffered(Stdout, *N)
     # . . push args
@@ -48,8 +46,7 @@ $loop:
 
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 == data 0x0a000000
 
diff --git a/apps/sigils b/apps/sigils
index ef6518ec..201c69fe 100755
--- a/apps/sigils
+++ b/apps/sigils
Binary files differdiff --git a/apps/sigils.subx b/apps/sigils.subx
index fd973fab..7c9ec805 100644
--- a/apps/sigils.subx
+++ b/apps/sigils.subx
@@ -99,8 +99,7 @@ $subx-sigils-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-sigils-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # error messages considered:
 #   *x + 34                 -> error: base+disp addressing must be within '()'
@@ -426,8 +425,7 @@ $subx-sigils:error1:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 test-subx-sigils-passes-most-words-through:
@@ -1803,8 +1801,7 @@ $next-word-or-expression:error1:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $next-word-or-expression:error2:
@@ -1842,8 +1839,7 @@ $next-word-or-expression:error2:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 test-next-word-or-expression:
@@ -2571,8 +2567,7 @@ $parse-effective-address:error1:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $parse-effective-address:error2:
@@ -2610,8 +2605,7 @@ $parse-effective-address:error2:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $parse-effective-address:error3:
@@ -2649,8 +2643,7 @@ $parse-effective-address:error3:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $parse-effective-address:error4:
@@ -2688,8 +2681,7 @@ $parse-effective-address:error4:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 # assumes 'in' starts with a register name, and returns pointer to its code
@@ -4161,8 +4153,7 @@ $next-hex-int:abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 test-next-hex-int-single-digit:
diff --git a/apps/survey b/apps/survey
index c1c8e9c5..91a05441 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/survey.subx b/apps/survey.subx
index c227a0fc..6ed94c5e 100644
--- a/apps/survey.subx
+++ b/apps/survey.subx
@@ -103,8 +103,7 @@ $subx-survey-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-survey-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # data structures:
 #   segment-info: {address, file-offset, size}                                  (12 bytes)
@@ -922,8 +921,7 @@ $compute-offsets:abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 test-compute-offsets:
@@ -2361,8 +2359,7 @@ $emit-segments:global-variable-abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $emit-segments:imm8-abort:
@@ -2376,8 +2373,7 @@ $emit-segments:imm8-abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 $emit-segments:abort:
@@ -2407,8 +2403,7 @@ $emit-segments:abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 test-emit-segments-global-variable:
@@ -3414,8 +3409,7 @@ $stream-add4:abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 stream-add5:  # in: (addr stream byte), key: handle, val1: addr, val2: addr, val3: addr
@@ -3501,8 +3495,7 @@ $stream-add5:abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 stream-add6:  # in: (addr stream byte), key: handle, val1: addr, val2: addr, val3: addr, val4: addr
@@ -3597,8 +3590,7 @@ $stream-add6:abort:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
     bb/copy-to-ebx  1/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 # some variants of 'trace' that take multiple arguments in different combinations of types:
diff --git a/apps/tests b/apps/tests
index 408ead69..aa317d7c 100755
--- a/apps/tests
+++ b/apps/tests
Binary files differdiff --git a/apps/tests.subx b/apps/tests.subx
index ff09730a..75f8ef22 100644
--- a/apps/tests.subx
+++ b/apps/tests.subx
@@ -64,8 +64,7 @@ $subx-tests-main:interactive:
     # syscall(exit, 0)
     bb/copy-to-ebx  0/imm32
 $subx-tests-main:end:
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 subx-gen-run-tests:  # in: (addr buffered-file), out: (addr buffered-file)
     # pseudocode