diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-11-27 12:04:53 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-11-27 12:04:53 -0800 |
commit | 2131b055f5ce1292e5f115fe66b25b8e5c6c5883 (patch) | |
tree | 65adcf8ddf2d18a37a3a92ac0deffb78dff08c3c /subx/057stop.subx | |
parent | 71d7081a7ccf0af6e5887856ada32b468bcca30f (diff) | |
download | mu-2131b055f5ce1292e5f115fe66b25b8e5c6c5883.tar.gz |
4787
Diffstat (limited to 'subx/057stop.subx')
-rw-r--r-- | subx/057stop.subx | 13 |
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 |