about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--050_write.subx10
-rw-r--r--051test.subx3
-rw-r--r--052kernel-string-equal.subx3
-rw-r--r--053new-segment.subx6
-rw-r--r--054string-equal.subx3
-rw-r--r--056trace.subx3
-rw-r--r--059stop.subx3
-rw-r--r--060read.subx3
-rw-r--r--062write-stream.subx9
-rw-r--r--064write-byte.subx3
-rw-r--r--067parse-hex.subx3
-rw-r--r--068error-byte.subx3
-rw-r--r--069allocate.subx12
-rw-r--r--070new-stream.subx3
-rw-r--r--071read-line.subx6
-rw-r--r--072slice.subx6
-rw-r--r--075print-int-decimal.subx3
-rw-r--r--081table.subx23
-rw-r--r--082slurp.subx3
-rw-r--r--091write-int.subx3
-rw-r--r--092stack.subx9
-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
54 files changed, 108 insertions, 213 deletions
diff --git a/050_write.subx b/050_write.subx
index 24acf888..2567f444 100644
--- a/050_write.subx
+++ b/050_write.subx
@@ -6,10 +6,8 @@
 # . 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
 
 Entry:  # just exit; can't test _write just yet
-    # . 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
 
 _write:  # fd: int, s: (addr array byte)
     # . prologue
@@ -30,8 +28,7 @@ _write:  # fd: int, s: (addr array byte)
     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           2/r32/edx   0xc/disp8       .                 # copy *(ebp+12) to edx
     8b/copy                         0/mod/indirect  2/rm32/edx    .           .             .           2/r32/edx   .               .                 # copy *edx to edx
     # . syscall
-    b8/copy-to-eax  4/imm32/write
-    cd/syscall  0x80/imm8
+    e8/call  syscall_write/disp32
     # if (eax < 0) abort
     3d/compare-eax-with  0/imm32
     0f 8c/jump-if-<  $_write:abort/disp32
@@ -50,8 +47,7 @@ $_write:abort:
     # can't write a message here for risk of an infinite loop, so we'll use a special exit code instead
     # . syscall(exit, 255)
     bb/copy-to-ebx  0xff/imm32
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
     # never gets here
 
 # . . vim:nowrap:textwidth=0
diff --git a/051test.subx b/051test.subx
index 518ed0de..04fbea24 100644
--- a/051test.subx
+++ b/051test.subx
@@ -17,8 +17,7 @@ Entry:  # manual test
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
     # 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
 
 # print msg to stderr if a != b, otherwise print "."
 check-ints-equal:  # a: int, b: int, msg: (addr array byte)
diff --git a/052kernel-string-equal.subx b/052kernel-string-equal.subx
index 4eeffe11..bcfd1848 100644
--- a/052kernel-string-equal.subx
+++ b/052kernel-string-equal.subx
@@ -26,8 +26,7 @@ Entry:  # run all tests
     e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
     # syscall(exit, Num-test-failures)
     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 kernel-string-equal?:  # s: (addr kernel-string), benchmark: (addr array byte) -> eax: boolean
     # pseudocode:
diff --git a/053new-segment.subx b/053new-segment.subx
index a400eeed..4c249abe 100644
--- a/053new-segment.subx
+++ b/053new-segment.subx
@@ -35,8 +35,7 @@ Entry:   # manual test
     c7          0/subop/copy        0/mod/direct    0/rm32/eax    .           .             .           .           .               0x34/imm32        # copy to *eax
     # syscall(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
 
 new-segment:  # len: int, ad: (addr allocation-descriptor)
     # . prologue
@@ -50,8 +49,7 @@ new-segment:  # len: int, ad: (addr allocation-descriptor)
     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   $_mmap-new-segment:len/disp32     # copy eax to *$_mmap-new-segment:len
     # mmap(_mmap-new-segment)
     bb/copy-to-ebx  _mmap-new-segment/imm32
-    b8/copy-to-eax  0x5a/imm32/mmap
-    cd/syscall  0x80/imm8
+    e8/call  syscall_mmap/disp32
     # copy {eax, eax+len} to *ad
     # . ebx = ad
     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           3/r32/ebx   0xc/disp8       .                 # copy *(ebp+12) to ebx
diff --git a/054string-equal.subx b/054string-equal.subx
index 24d001b0..d193bb2d 100644
--- a/054string-equal.subx
+++ b/054string-equal.subx
@@ -10,8 +10,7 @@ Entry:  # run all tests
     e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
     # syscall(exit, Num-test-failures)
     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 string-equal?:  # s: (addr array byte), benchmark: (addr array byte) -> eax: boolean
     # pseudocode:
diff --git a/056trace.subx b/056trace.subx
index 45ab2792..cc6a7b43 100644
--- a/056trace.subx
+++ b/056trace.subx
@@ -954,8 +954,7 @@ $_append-4: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
 
 == data
diff --git a/059stop.subx b/059stop.subx
index bb7ca779..85b6ad36 100644
--- a/059stop.subx
+++ b/059stop.subx
@@ -98,8 +98,7 @@ stop:  # ed: (addr exit-descriptor), value: int
     75/jump-if-!=  $stop:fake/disp8
     # . syscall(exit, value)
     8b/copy                         1/mod/*+disp8   4/rm32/sib    4/base/esp  4/index/none  .           3/r32/ebx   8/disp8         .                 # copy *(esp+8) to ebx
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 $stop:fake:
     # otherwise:
     # ed->value = value+1
diff --git a/060read.subx b/060read.subx
index 661624b2..1f5a557d 100644
--- a/060read.subx
+++ b/060read.subx
@@ -218,8 +218,7 @@ _read:  # fd: int, s: (addr stream byte) -> num-bytes-read/eax: int
     # . . size: edx = s->size - s->write
     29/subtract                     3/mod/direct    2/rm32/edx    .           .             .           0/r32/eax   .               .                 # subtract eax from edx
     # . . syscall
-    b8/copy-to-eax  3/imm32/read
-    cd/syscall  0x80/imm8
+    e8/call  syscall_read/disp32
     # add the result eax to s->write
     01/add                          0/mod/indirect  6/rm32/esi    .           .             .           0/r32/eax   .               .                 # add eax to *esi
 $_read:end:
diff --git a/062write-stream.subx b/062write-stream.subx
index 22fc64d1..d7e975c0 100644
--- a/062write-stream.subx
+++ b/062write-stream.subx
@@ -12,8 +12,7 @@
 #?     e8/call write-stream/disp32
 #?     # syscall(exit, Num-test-failures)
 #?     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
-#?     b8/copy-to-eax  1/imm32/exit
-#?     cd/syscall  0x80/imm8
+#?     e8/call  syscall_exit/disp32
 
 write-stream:  # f: fd or (addr stream byte), s: (addr stream byte)
     # . prologue
@@ -100,8 +99,7 @@ _write-stream:  # fd: int, s: (addr stream byte)
     # . . size: edx = s->write - s->read
     29/subtract                     3/mod/direct    2/rm32/edx    .           .             .           7/r32/edi   .               .                 # subtract edi from edx
     # . . syscall
-    b8/copy-to-eax  4/imm32/write
-    cd/syscall  0x80/imm8
+    e8/call  syscall_write/disp32
     # if (eax < 0) abort
     3d/compare-eax-with  0/imm32
     0f 8c/jump-if-<  $_write-stream:abort/disp32
@@ -130,8 +128,7 @@ $_write-stream: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-write-stream-single:
diff --git a/064write-byte.subx b/064write-byte.subx
index b134a2a8..889439f6 100644
--- a/064write-byte.subx
+++ b/064write-byte.subx
@@ -247,8 +247,7 @@ $append-byte: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-append-byte-single:
diff --git a/067parse-hex.subx b/067parse-hex.subx
index b5a5bacf..e9136696 100644
--- a/067parse-hex.subx
+++ b/067parse-hex.subx
@@ -932,8 +932,7 @@ $from-hex-char: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
 
 # . . vim:nowrap:textwidth=0
diff --git a/068error-byte.subx b/068error-byte.subx
index 31b40a3f..1d7729b5 100644
--- a/068error-byte.subx
+++ b/068error-byte.subx
@@ -20,8 +20,7 @@
 #?     e8/call  error-byte/disp32
 #?     # . syscall(exit, Num-test-failures)
 #?     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
-#?     b8/copy-to-eax  1/imm32/exit
-#?     cd/syscall  0x80/imm8
+#?     e8/call  syscall_exit/disp32
 
 # write(out, "Error: "+msg+": "+byte) then stop(ed, 1)
 error-byte:  # ed: (addr exit-descriptor), out: (addr buffered-file), msg: (addr array byte), n: byte
diff --git a/069allocate.subx b/069allocate.subx
index c65a369e..4778b3ed 100644
--- a/069allocate.subx
+++ b/069allocate.subx
@@ -59,8 +59,7 @@ Entry:
 $array-equal-main:end:
     # syscall(exit, Num-test-failures)
     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 # Allocate and clear 'n' bytes of memory from an allocation-descriptor 'ad'.
 # Abort if there isn't enough memory in 'ad'.
@@ -164,8 +163,7 @@ $allocate-raw: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-allocate-raw-success:
@@ -294,8 +292,7 @@ $lookup: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/exit-status
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    e8/call  syscall_exit/disp32
 
 test-lookup-success:
     # . prologue
@@ -571,8 +568,7 @@ $allocate-region: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
 
 # Claim the next 'n+4' bytes of memory and initialize the first 4 to n.
diff --git a/070new-stream.subx b/070new-stream.subx
index a219c347..e781ecd6 100644
--- a/070new-stream.subx
+++ b/070new-stream.subx
@@ -68,8 +68,7 @@ $new-stream: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-new-stream:
diff --git a/071read-line.subx b/071read-line.subx
index b230c9ca..02dcc0fd 100644
--- a/071read-line.subx
+++ b/071read-line.subx
@@ -104,8 +104,7 @@ $read-line-buffered: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-read-line-buffered:
@@ -289,8 +288,7 @@ $read-line: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-read-line:
diff --git a/072slice.subx b/072slice.subx
index b2ff476f..3809f34e 100644
--- a/072slice.subx
+++ b/072slice.subx
@@ -858,8 +858,7 @@ $write-slice: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-write-slice:
@@ -1123,8 +1122,7 @@ $slice-to-string: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-slice-to-string:
diff --git a/075print-int-decimal.subx b/075print-int-decimal.subx
index 135d8f0d..62d9b6e0 100644
--- a/075print-int-decimal.subx
+++ b/075print-int-decimal.subx
@@ -124,8 +124,7 @@ $print-int32-decimal: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-print-int32-decimal:
diff --git a/081table.subx b/081table.subx
index 620784b7..4507b10d 100644
--- a/081table.subx
+++ b/081table.subx
@@ -124,8 +124,7 @@ $get: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-get:
@@ -316,8 +315,7 @@ $get-slice: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-get-slice:
@@ -534,8 +532,7 @@ $get-or-insert: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-get-or-insert:
@@ -821,8 +818,7 @@ $get-or-insert-handle: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-get-or-insert-handle:
@@ -1139,8 +1135,7 @@ $get-or-insert-slice: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-get-or-insert-slice:
@@ -1440,8 +1435,8 @@ $get-or-stop:terminus:
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # syscall(exit, 1)
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    bb/copy-to-ebx  1/imm32
+    e8/call  syscall_exit/disp32
 
 test-get-or-stop:
     # This test uses exit-descriptors. Use ebp for setting up local variables.
@@ -1666,8 +1661,8 @@ $get-slice-or-stop:terminus:
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # syscall(exit, 1)
-    b8/copy-to-eax  1/imm32/exit
-    cd/syscall  0x80/imm8
+    bb/copy-to-ebx  1/imm32
+    e8/call  syscall_exit/disp32
 
 test-get-slice-or-stop:
     # This test uses exit-descriptors. Use ebp for setting up local variables.
diff --git a/082slurp.subx b/082slurp.subx
index 10c51135..ed590fa0 100644
--- a/082slurp.subx
+++ b/082slurp.subx
@@ -100,8 +100,7 @@ $slurp: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-slurp:
diff --git a/091write-int.subx b/091write-int.subx
index 4db7eab3..2b5b60a1 100644
--- a/091write-int.subx
+++ b/091write-int.subx
@@ -47,8 +47,7 @@ $write-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-write-int-single:
diff --git a/092stack.subx b/092stack.subx
index a0bafe5e..0ab80b99 100644
--- a/092stack.subx
+++ b/092stack.subx
@@ -160,8 +160,7 @@ $push: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-push:
@@ -279,8 +278,7 @@ $pop: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-pop:
@@ -381,8 +379,7 @@ $top: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-top:
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