about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--059stop.subx2
-rw-r--r--078table.subx37
-rwxr-xr-xapps/assortbin35848 -> 35948 bytes
-rwxr-xr-xapps/crenshaw2-1bin29582 -> 29682 bytes
-rwxr-xr-xapps/crenshaw2-1bbin30141 -> 30241 bytes
-rwxr-xr-xapps/dquotesbin42404 -> 42504 bytes
-rwxr-xr-xapps/factorialbin28594 -> 28694 bytes
-rwxr-xr-xapps/handlebin29448 -> 29548 bytes
-rwxr-xr-xapps/hexbin38241 -> 38341 bytes
-rwxr-xr-xapps/packbin48534 -> 48634 bytes
-rwxr-xr-xapps/surveybin45131 -> 45231 bytes
-rwxr-xr-xapps/testsbin34660 -> 34760 bytes
12 files changed, 34 insertions, 5 deletions
diff --git a/059stop.subx b/059stop.subx
index 64444314..7fc99a27 100644
--- a/059stop.subx
+++ b/059stop.subx
@@ -144,7 +144,7 @@ test-stop-skips-returns-on-exit:
     # restore args
     58/pop-to-EAX
     # check that _test-stop-1 tried to call exit(1)
-    # check-ints-equal(ed->value, 2, msg)  # i.e. stop was called with value 1
+    # . check-ints-equal(ed->value, 2, msg)  # i.e. stop was called with value 1
     # . . push args
     68/push  "F - test-stop-skips-returns-on-exit"/imm32
     68/push  2/imm32
diff --git a/078table.subx b/078table.subx
index 09903f81..0a6e7c57 100644
--- a/078table.subx
+++ b/078table.subx
@@ -922,7 +922,7 @@ $test-leaky-get-or-insert-slice:end:
     5d/pop-to-EBP
     c3/return
 
-# if no row is found, stop using 'ed'
+# if no row is found, stop(ed)
 get-or-stop:  # table : (address stream {string, _}), key : (address string), row-size : int,
               # abort-message-prefix : (address string), err : (address buffered-file), ed : (address exit-descriptor)
               # -> EAX : (address _)
@@ -994,7 +994,7 @@ $get-or-stop:stop:
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # . write-buffered(err, error)
     # . . push args
-    68/push  ": get: key not found: "/imm32
+    68/push  ": get-or-stop: key not found: "/imm32
     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0x18/disp8      .                 # push *(EBP+24)
     # . . call
     e8/call  write-buffered/disp32
@@ -1018,7 +1018,7 @@ $get-or-stop:stop:
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # . stop(ed, 1)
     # . . push args
-    bb/copy-to-EBX  1/imm32
+    68/push  1/imm32
     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0x1c/disp8      .                 # push *(EBP+28)
     # . . call
     e8/call  stop/disp32
@@ -1035,7 +1035,7 @@ test-get-or-stop:
     # . prolog
     55/push-EBP
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # - setup
+    # setup
     # . clear-stream(_test-error-stream)
     # . . push args
     68/push  _test-error-stream/imm32
@@ -1093,6 +1093,7 @@ $test-get-or-stop:success:
     e8/call  get-or-stop/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x18/imm32        # add to ESP
+$test-get-or-stop:success-assertion:
     # check-ints-equal(EAX - table->data, 4, msg)
     # . check-ints-equal(EAX - table, 16, msg)
     # . . push args
@@ -1104,6 +1105,34 @@ $test-get-or-stop:success:
     e8/call  check-ints-equal/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
+$test-get-or-stop:failure:
+    # EAX = get-or-stop(table, "data", row-size=8, msg, _test-error-buffered-file, ed)
+    # . . push args
+    52/push-EDX/ed
+    68/push  _test-error-buffered-file/imm32
+    68/push  "foo"/imm32
+    68/push  8/imm32/row-size
+    68/push  "data"/imm32
+    51/push-ECX
+    # . . call
+    e8/call  get-or-stop/disp32
+    # registers except ESP may be clobbered at this point
+    # restore register args, discard others
+    59/pop-to-ECX
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
+    5a/pop-to-EDX
+$test-get-or-stop:failure-assertion:
+    # check that get-or-stop tried to call stop(1)
+    # . check-ints-equal(ed->value, 2, msg)
+    # . . push args
+    68/push  "F - test-get-or-stop/1"/imm32
+    68/push  2/imm32
+    # . . push ed->value
+    ff          6/subop/push        1/mod/*+disp8   2/rm32/EDX    .           .             .           .           4/disp8         .                 # push *(EDX+4)
+    # . . call
+    e8/call  check-ints-equal/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
 $test-get-or-stop:end:
     # . epilog
     # don't restore ESP from EBP; manually reclaim locals
diff --git a/apps/assort b/apps/assort
index 5a4ff14e..97660d3c 100755
--- a/apps/assort
+++ b/apps/assort
Binary files differdiff --git a/apps/crenshaw2-1 b/apps/crenshaw2-1
index a1919314..4b8559fd 100755
--- a/apps/crenshaw2-1
+++ b/apps/crenshaw2-1
Binary files differdiff --git a/apps/crenshaw2-1b b/apps/crenshaw2-1b
index e806dd96..f1f34232 100755
--- a/apps/crenshaw2-1b
+++ b/apps/crenshaw2-1b
Binary files differdiff --git a/apps/dquotes b/apps/dquotes
index 156efcf6..1ccfd2a7 100755
--- a/apps/dquotes
+++ b/apps/dquotes
Binary files differdiff --git a/apps/factorial b/apps/factorial
index ef2f24a7..b7b51d79 100755
--- a/apps/factorial
+++ b/apps/factorial
Binary files differdiff --git a/apps/handle b/apps/handle
index 2243ab53..9ed11054 100755
--- a/apps/handle
+++ b/apps/handle
Binary files differdiff --git a/apps/hex b/apps/hex
index d0472e49..7bf66c63 100755
--- a/apps/hex
+++ b/apps/hex
Binary files differdiff --git a/apps/pack b/apps/pack
index 1174a82a..ead510f0 100755
--- a/apps/pack
+++ b/apps/pack
Binary files differdiff --git a/apps/survey b/apps/survey
index f23e4590..6ca419a6 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/tests b/apps/tests
index 193bb969..cfb1fbe7 100755
--- a/apps/tests
+++ b/apps/tests
Binary files differ
> ^
5b0a415f ^




0a3bc57c ^







51530916 ^

c08e91ff ^
51530916 ^





c08e91ff ^
51530916 ^





c08e91ff ^
51530916 ^






c08e91ff ^
51530916 ^






c08e91ff ^
51530916 ^





c08e91ff ^
51530916 ^







c08e91ff ^
51530916 ^






c08e91ff ^
51530916 ^







c08e91ff ^
51530916 ^




ad796a56 ^

c08e91ff ^
ad796a56 ^



9429b278 ^

c08e91ff ^
9429b278 ^



51530916 ^





c08e91ff ^
51530916 ^
c08e91ff ^



51530916 ^


b35ac82d ^










c08e91ff ^






51530916 ^

c08e91ff ^
51530916 ^
c08e91ff ^



51530916 ^





97f3bbac ^
0e82b1d4 ^
c08e91ff ^
97f3bbac ^
c08e91ff ^




97f3bbac ^


51530916 ^

c08e91ff ^
51530916 ^
c08e91ff ^



51530916 ^




c08e91ff ^
51530916 ^
c08e91ff ^



51530916 ^




c08e91ff ^
51530916 ^
c08e91ff ^



51530916 ^




c08e91ff ^
51530916 ^
c08e91ff ^





51530916 ^




c08e91ff ^
51530916 ^
c08e91ff ^




51530916 ^




c08e91ff ^
51530916 ^
c08e91ff ^




51530916 ^


c51043ab ^










4f5cf668 ^




518e6c5e ^
4f5cf668 ^






518e6c5e ^











51530916 ^




































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366