about summary refs log tree commit diff stats
path: root/subx/057stop.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-11-27 12:04:53 -0800
committerKartik Agaram <vc@akkartik.com>2018-11-27 12:04:53 -0800
commit2131b055f5ce1292e5f115fe66b25b8e5c6c5883 (patch)
tree65adcf8ddf2d18a37a3a92ac0deffb78dff08c3c /subx/057stop.subx
parent71d7081a7ccf0af6e5887856ada32b468bcca30f (diff)
downloadmu-2131b055f5ce1292e5f115fe66b25b8e5c6c5883.tar.gz
4787
Diffstat (limited to 'subx/057stop.subx')
-rw-r--r--subx/057stop.subx13
1 files changed, 10 insertions, 3 deletions
diff --git a/subx/057stop.subx b/subx/057stop.subx
index 8de167f0..9bdf69c3 100644
--- a/subx/057stop.subx
+++ b/subx/057stop.subx
@@ -16,14 +16,21 @@
 # input target with an output status parameter into a type called 'exit-descriptor'.
 #
 # So the exit-descriptor looks like this:
-#   target : address  # input return address for 'stop' to unwind to
-#   value : int  # output exit status stop was called with
+#   target : address  # return address for 'stop' to unwind to
+#   value : int  # exit status stop was called with
 #
 # 'stop' thus takes two parameters: an exit-descriptor and the exit status.
 #
-# We won't bother cleaning up any other processor state besides the stack,
+# 'stop' won't bother cleaning up any other processor state besides the stack,
 # such as registers. Only ESP will have a well-defined value after 'stop'
 # returns. (This is a poor man's setjmp/longjmp, if you know what that is.)
+#
+# Before you an call any function that may call 'stop', you need to pass in an
+# exit-descriptor to it. To create an exit-descriptor use 'tailor-exit-descriptor'
+# below. It's not the most pleasant abstraction in the world.
+#
+# An exit-descriptor's target is its input, computed during 'tailor-exit-descriptor'.
+# Its value is its output, computed during stop and available to the test.
 
 == code
 # instruction                     effective address                                                   operand     displacement    immediate
'#n178'>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
 id='n212' href='#n212'>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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405