diff --git a/html/subx/056write.subx.html b/html/subx/056write.subx.html
index 7ada1e78..727bda6b 100644
--- a/html/subx/056write.subx.html
+++ b/html/subx/056write.subx.html
@@ -92,55 +92,55 @@ if ('onhashchange' in window) {
27 b8/copy-to-EAX 1/imm32
28 cd/syscall 0x80/imm8
29
- 30 write:
- 31
- 32
- 33
- 34
- 35 55/push-EBP
- 36 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
- 37
- 38 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8 0x08000000/imm32
- 39 7d/jump-if-greater-or-equal $write:fake/disp8
- 40
- 41 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
- 42 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8
- 43
- 44 e8/call _write/disp32
- 45
- 46 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
- 47 eb/jump $write:end/disp8
- 48 $write:fake:
- 49
- 50
- 51 51/push-ECX
- 52 52/push-EDX
- 53 53/push-EBX
- 54
- 55 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 1/r32/ECX 8/disp8
- 56
- 57 8b/copy 0/mod/indirect 1/rm32/ECX 2/r32/EDX
- 58
- 59 8b/copy 1/mod/*+disp8 1/rm32/ECX 3/r32/EBX 8/disp8
- 60
- 61
- 62 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
- 63
- 64 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 3/index/EBX 3/r32/EBX 0xc/disp8
- 65 53/push-EBX
- 66
- 67 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX 3/r32/EBX 0xc/disp8
- 68 53/push-EBX
- 69
- 70 e8/call _append-3/disp32
- 71
- 72 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
- 73
- 74 01/add 0/mod/indirect 1/rm32/ECX 0/r32/EAX
- 75
- 76 5b/pop-to-EBX
- 77 5a/pop-to-EDX
- 78 59/pop-to-ECX
+ 30
+ 31 write:
+ 32
+ 33 55/push-EBP
+ 34 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
+ 35
+ 36 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8 0x08000000/imm32
+ 37 7d/jump-if-greater-or-equal $write:fake/disp8
+ 38
+ 39 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
+ 40 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8
+ 41
+ 42 e8/call _write/disp32
+ 43
+ 44 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
+ 45 eb/jump $write:end/disp8
+ 46 $write:fake:
+ 47
+ 48
+ 49 50/push-EAX
+ 50 51/push-ECX
+ 51 52/push-EDX
+ 52 53/push-EBX
+ 53
+ 54 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 1/r32/ECX 8/disp8
+ 55
+ 56 8b/copy 0/mod/indirect 1/rm32/ECX 2/r32/EDX
+ 57
+ 58 8b/copy 1/mod/*+disp8 1/rm32/ECX 3/r32/EBX 8/disp8
+ 59
+ 60
+ 61 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
+ 62
+ 63 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 3/index/EBX 3/r32/EBX 0xc/disp8
+ 64 53/push-EBX
+ 65
+ 66 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX 3/r32/EBX 0xc/disp8
+ 67 53/push-EBX
+ 68
+ 69 e8/call _append-3/disp32
+ 70
+ 71 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
+ 72
+ 73 01/add 0/mod/indirect 1/rm32/ECX 0/r32/EAX
+ 74
+ 75 5b/pop-to-EBX
+ 76 5a/pop-to-EDX
+ 77 59/pop-to-ECX
+ 78 58/pop-to-EAX
79 $write:end:
80
81 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
diff --git a/subx/056write.subx b/subx/056write.subx
index 3496d980..c76d0737 100644
--- a/subx/056write.subx
+++ b/subx/056write.subx
@@ -27,10 +27,8 @@
b8/copy-to-EAX 1/imm32
cd/syscall 0x80/imm8
-write: # f : fd or (address stream), s : (address array byte) -> bytes_written/EAX
- # (If we ever leave the Linux kernel behind, it may be better to return
- # the number of bytes *not* written. Success would then be signaled by
- # returning 0.)
+# TODO: come up with a way to signal when a write to disk fails
+write: # f : fd or (address stream), s : (address array byte) ->
# . prolog
55/push-EBP
89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP
@@ -48,6 +46,7 @@ write: # f : fd or (address stream), s : (address array byte) -> bytes_written/
$write:fake:
# otherwise, treat 'f' as a stream to append to
# . save registers
+ 50/push-EAX
51/push-ECX
52/push-EDX
53/push-EBX
@@ -76,6 +75,7 @@ $write:fake:
5b/pop-to-EBX
5a/pop-to-EDX
59/pop-to-ECX
+ 58/pop-to-EAX
$write:end:
# . epilog
89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP
diff --git a/subx/apps/crenshaw2-1 b/subx/apps/crenshaw2-1
index 47762af7..10003ae7 100755
Binary files a/subx/apps/crenshaw2-1 and b/subx/apps/crenshaw2-1 differ
diff --git a/subx/apps/crenshaw2-1b b/subx/apps/crenshaw2-1b
index 620c1bad..20eaafe0 100755
Binary files a/subx/apps/crenshaw2-1b and b/subx/apps/crenshaw2-1b differ
diff --git a/subx/apps/factorial b/subx/apps/factorial
index d3a50805..7d867940 100755
Binary files a/subx/apps/factorial and b/subx/apps/factorial differ