diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-10-26 23:51:14 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-10-26 23:51:14 -0700 |
commit | 999c529cb972079df3bc693945be34a77336ddf4 (patch) | |
tree | 866ef92e03a5206ec95c75996788d9f4ae207981 /html/081table.subx.html | |
parent | 0fba3393a5becfb38dea19464e02dc17a64b7574 (diff) | |
download | mu-999c529cb972079df3bc693945be34a77336ddf4.tar.gz |
5716
Diffstat (limited to 'html/081table.subx.html')
-rw-r--r-- | html/081table.subx.html | 1306 |
1 files changed, 651 insertions, 655 deletions
diff --git a/html/081table.subx.html b/html/081table.subx.html index 0c963e42..2de1deee 100644 --- a/html/081table.subx.html +++ b/html/081table.subx.html @@ -335,16 +335,16 @@ if ('onhashchange' in window) { <span id="L274" class="LineNr"> 274 </span> <span class="subxS1Comment"># . write-slice-buffered(Stderr, key)</span> <span id="L275" class="LineNr"> 275 </span> <span class="subxS2Comment"># . . push args</span> <span id="L276" class="LineNr"> 276 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> -<span id="L277" class="LineNr"> 277 </span> 68/push <span class="SpecialChar"><a href='065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L277" class="LineNr"> 277 </span> 68/push <span class="SpecialChar"><a href='065write-buffered.subx.html#L209'>Stderr</a></span>/imm32 <span id="L278" class="LineNr"> 278 </span> <span class="subxS2Comment"># . . call</span> <span id="L279" class="LineNr"> 279 </span> e8/call <a href='072slice.subx.html#L878'>write-slice-buffered</a>/disp32 <span id="L280" class="LineNr"> 280 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L281" class="LineNr"> 281 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> <span id="L282" class="LineNr"> 282 </span> <span class="subxS1Comment"># . flush(Stderr)</span> <span id="L283" class="LineNr"> 283 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L284" class="LineNr"> 284 </span> 68/push <span class="SpecialChar"><a href='065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L284" class="LineNr"> 284 </span> 68/push <span class="SpecialChar"><a href='065write-buffered.subx.html#L209'>Stderr</a></span>/imm32 <span id="L285" class="LineNr"> 285 </span> <span class="subxS2Comment"># . . call</span> -<span id="L286" class="LineNr"> 286 </span> e8/call <a href='064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L286" class="LineNr"> 286 </span> e8/call <a href='064write-byte.subx.html#L81'>flush</a>/disp32 <span id="L287" class="LineNr"> 287 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L288" class="LineNr"> 288 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> <span id="L289" class="LineNr"> 289 </span> <span class="subxS1Comment"># . _write(2/stderr, "\n")</span> @@ -785,7 +785,7 @@ if ('onhashchange' in window) { <span id="L724" class="LineNr"> 724 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> <span id="L725" class="LineNr"> 725 </span> 68/push <span class="SpecialChar"><a href='069allocate.subx.html#L22'>Heap</a></span>/imm32 <span id="L726" class="LineNr"> 726 </span> <span class="subxS2Comment"># . . call</span> -<span id="L727" class="LineNr"> 727 </span> e8/call <a href='072slice.subx.html#L1015'>slice-to-string</a>/disp32 +<span id="L727" class="LineNr"> 727 </span> e8/call <a href='072slice.subx.html#L1013'>slice-to-string</a>/disp32 <span id="L728" class="LineNr"> 728 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L729" class="LineNr"> 729 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> <span id="L730" class="LineNr"> 730 </span> <span class="subxS1Comment"># . *max = eax</span> @@ -1099,662 +1099,658 @@ if ('onhashchange' in window) { <span id="L1038" class="LineNr">1038 </span> <span class="subxComment"># setup</span> <span id="L1039" class="LineNr">1039 </span> <span class="subxS1Comment"># . clear-stream(_test-error-stream)</span> <span id="L1040" class="LineNr">1040 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1041" class="LineNr">1041 </span> 68/push <a href='064write-byte.subx.html#L344'>_test-error-stream</a>/imm32 +<span id="L1041" class="LineNr">1041 </span> 68/push <a href='064write-byte.subx.html#L341'>_test-error-stream</a>/imm32 <span id="L1042" class="LineNr">1042 </span> <span class="subxS2Comment"># . . call</span> <span id="L1043" class="LineNr">1043 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 <span id="L1044" class="LineNr">1044 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1045" class="LineNr">1045 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> -<span id="L1046" class="LineNr">1046 </span> <span class="subxS1Comment"># . clear-stream(_test-error-buffered-file+4)</span> +<span id="L1046" class="LineNr">1046 </span> <span class="subxS1Comment"># . clear-stream(_test-error-buffered-file->buffer)</span> <span id="L1047" class="LineNr">1047 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1048" class="LineNr">1048 </span> b8/copy-to-eax <a href='064write-byte.subx.html#L362'>_test-error-buffered-file</a>/imm32 -<span id="L1049" class="LineNr">1049 </span> 05/add-to-eax 4/imm32 -<span id="L1050" class="LineNr">1050 </span> 50/push-eax -<span id="L1051" class="LineNr">1051 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1052" class="LineNr">1052 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L1053" class="LineNr">1053 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1054" class="LineNr">1054 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> -<span id="L1055" class="LineNr">1055 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> -<span id="L1056" class="LineNr">1056 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> -<span id="L1057" class="LineNr">1057 </span> 68/push 0x10/imm32/length -<span id="L1058" class="LineNr">1058 </span> 68/push 0/imm32/read -<span id="L1059" class="LineNr">1059 </span> 68/push 0/imm32/write -<span id="L1060" class="LineNr">1060 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> -<span id="L1061" class="LineNr">1061 </span> <span class="subxComment"># var ed/edx : (address exit-descriptor)</span> -<span id="L1062" class="LineNr">1062 </span> 68/push 0/imm32 -<span id="L1063" class="LineNr">1063 </span> 68/push 0/imm32 -<span id="L1064" class="LineNr">1064 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> -<span id="L1065" class="LineNr">1065 </span> <span class="subxComment"># size 'ed' for the calls to 'get-or-stop'</span> -<span id="L1066" class="LineNr">1066 </span> <span class="subxS1Comment"># . tailor-exit-descriptor(ed, 24)</span> -<span id="L1067" class="LineNr">1067 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1068" class="LineNr">1068 </span> 68/push 0x18/imm32/nbytes-of-args-for-get-or-stop -<span id="L1069" class="LineNr">1069 </span> 52/push-edx -<span id="L1070" class="LineNr">1070 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1071" class="LineNr">1071 </span> e8/call <a href='059stop.subx.html#L44'>tailor-exit-descriptor</a>/disp32 -<span id="L1072" class="LineNr">1072 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1073" class="LineNr">1073 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1074" class="LineNr">1074 </span> <span class="subxComment"># insert(table, "code", 8 bytes per row)</span> -<span id="L1075" class="LineNr">1075 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1076" class="LineNr">1076 </span> 68/push 8/imm32/row-size -<span id="L1077" class="LineNr">1077 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1078" class="LineNr">1078 </span> 51/push-ecx -<span id="L1079" class="LineNr">1079 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1080" class="LineNr">1080 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 -<span id="L1081" class="LineNr">1081 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1082" class="LineNr">1082 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1083" class="LineNr">1083 </span><span class="Constant">$test-get-or-stop:success</span>: -<span id="L1084" class="LineNr">1084 </span> <span class="subxComment"># eax = get-or-stop(table, "code", row-size=8, msg, _test-error-buffered-file, ed)</span> -<span id="L1085" class="LineNr">1085 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1086" class="LineNr">1086 </span> 52/push-edx/ed -<span id="L1087" class="LineNr">1087 </span> 68/push <a href='064write-byte.subx.html#L362'>_test-error-buffered-file</a>/imm32 -<span id="L1088" class="LineNr">1088 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix -<span id="L1089" class="LineNr">1089 </span> 68/push 8/imm32/row-size -<span id="L1090" class="LineNr">1090 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1091" class="LineNr">1091 </span> 51/push-ecx -<span id="L1092" class="LineNr">1092 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1093" class="LineNr">1093 </span> e8/call <a href='081table.subx.html#L926'>get-or-stop</a>/disp32 -<span id="L1094" class="LineNr">1094 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1095" class="LineNr">1095 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/imm32 <span class="subxComment"># add to esp</span> -<span id="L1096" class="LineNr">1096 </span><span class="Constant">$test-get-or-stop:success-assertion</span>: -<span id="L1097" class="LineNr">1097 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg)</span> -<span id="L1098" class="LineNr">1098 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> -<span id="L1099" class="LineNr">1099 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1100" class="LineNr">1100 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1033'>test-get-or-stop</a>/0"</span>/imm32 -<span id="L1101" class="LineNr">1101 </span> 68/push 0x10/imm32 -<span id="L1102" class="LineNr">1102 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> -<span id="L1103" class="LineNr">1103 </span> 50/push-eax -<span id="L1104" class="LineNr">1104 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1105" class="LineNr">1105 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1106" class="LineNr">1106 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1107" class="LineNr">1107 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1108" class="LineNr">1108 </span><span class="Constant">$test-get-or-stop:failure</span>: -<span id="L1109" class="LineNr">1109 </span> <span class="subxComment"># eax = get-or-stop(table, "data", row-size=8, msg, _test-error-buffered-file, ed)</span> -<span id="L1110" class="LineNr">1110 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1111" class="LineNr">1111 </span> 52/push-edx/ed -<span id="L1112" class="LineNr">1112 </span> 68/push <a href='064write-byte.subx.html#L362'>_test-error-buffered-file</a>/imm32 -<span id="L1113" class="LineNr">1113 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix -<span id="L1114" class="LineNr">1114 </span> 68/push 8/imm32/row-size -<span id="L1115" class="LineNr">1115 </span> 68/push <span class="Constant">"data"</span>/imm32 -<span id="L1116" class="LineNr">1116 </span> 51/push-ecx -<span id="L1117" class="LineNr">1117 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1118" class="LineNr">1118 </span> e8/call <a href='081table.subx.html#L926'>get-or-stop</a>/disp32 -<span id="L1119" class="LineNr">1119 </span> <span class="subxComment"># registers except esp may be clobbered at this point</span> -<span id="L1120" class="LineNr">1120 </span> <span class="subxComment"># restore register args, discard others</span> -<span id="L1121" class="LineNr">1121 </span> 59/pop-to-ecx -<span id="L1122" class="LineNr">1122 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># add to esp</span> -<span id="L1123" class="LineNr">1123 </span> 5a/pop-to-edx -<span id="L1124" class="LineNr">1124 </span><span class="Constant">$test-get-or-stop:failure-assertion</span>: -<span id="L1125" class="LineNr">1125 </span> <span class="subxComment"># check that get-or-stop tried to call stop(1)</span> -<span id="L1126" class="LineNr">1126 </span> <span class="subxS1Comment"># . check-ints-equal(ed->value, 2, msg)</span> -<span id="L1127" class="LineNr">1127 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1128" class="LineNr">1128 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1033'>test-get-or-stop</a>/1"</span>/imm32 -<span id="L1129" class="LineNr">1129 </span> 68/push 2/imm32 -<span id="L1130" class="LineNr">1130 </span> <span class="subxS2Comment"># . . push ed->value</span> -<span id="L1131" class="LineNr">1131 </span> ff 6/subop/push 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(edx+4)</span> -<span id="L1132" class="LineNr">1132 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1133" class="LineNr">1133 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1134" class="LineNr">1134 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1135" class="LineNr">1135 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1136" class="LineNr">1136 </span><span class="Constant">$test-get-or-stop:end</span>: -<span id="L1137" class="LineNr">1137 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1138" class="LineNr">1138 </span> <span class="subxComment"># don't restore esp from ebp; manually reclaim locals</span> -<span id="L1139" class="LineNr">1139 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x24/imm32 <span class="subxComment"># add to esp</span> -<span id="L1140" class="LineNr">1140 </span> 5d/pop-to-ebp -<span id="L1141" class="LineNr">1141 </span> c3/return -<span id="L1142" class="LineNr">1142 </span> -<span id="L1143" class="LineNr">1143 </span><span class="subxComment"># if no row is found, stop(ed)</span> -<span id="L1144" class="LineNr">1144 </span><span class="subxFunction">get-slice-or-stop</span>: <span class="subxComment"># table : (address stream {string, _}), key : (address slice), row-size : int,</span> -<span id="L1145" class="LineNr">1145 </span> <span class="subxComment"># abort-message-prefix : (address string), err : (address buffered-file), ed : (address exit-descriptor)</span> -<span id="L1146" class="LineNr">1146 </span> <span class="subxComment"># -> eax : (address _)</span> -<span id="L1147" class="LineNr">1147 </span> <span class="subxComment"># pseudocode:</span> -<span id="L1148" class="LineNr">1148 </span> <span class="subxComment"># curr = table->data</span> -<span id="L1149" class="LineNr">1149 </span> <span class="subxComment"># max = &table->data[table->write]</span> -<span id="L1150" class="LineNr">1150 </span> <span class="subxComment"># while curr < max</span> -<span id="L1151" class="LineNr">1151 </span> <span class="subxComment"># if slice-equal?(key, *curr)</span> -<span id="L1152" class="LineNr">1152 </span> <span class="subxComment"># return curr+4</span> -<span id="L1153" class="LineNr">1153 </span> <span class="subxComment"># curr += row-size</span> -<span id="L1154" class="LineNr">1154 </span> <span class="subxComment"># write-buffered(err, msg)</span> -<span id="L1155" class="LineNr">1155 </span> <span class="subxComment"># stop(ed)</span> -<span id="L1156" class="LineNr">1156 </span> <span class="subxComment">#</span> -<span id="L1157" class="LineNr">1157 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1158" class="LineNr">1158 </span> 55/push-ebp -<span id="L1159" class="LineNr">1159 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> -<span id="L1160" class="LineNr">1160 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L1161" class="LineNr">1161 </span> 51/push-ecx -<span id="L1162" class="LineNr">1162 </span> 52/push-edx -<span id="L1163" class="LineNr">1163 </span> 56/push-esi -<span id="L1164" class="LineNr">1164 </span> <span class="subxComment"># esi = table</span> -<span id="L1165" class="LineNr">1165 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L1166" class="LineNr">1166 </span> <span class="subxComment"># curr/ecx = table->data</span> -<span id="L1167" class="LineNr">1167 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L1168" class="LineNr">1168 </span> <span class="subxComment"># max/edx = table->data + table->write</span> -<span id="L1169" class="LineNr">1169 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L1170" class="LineNr">1170 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> -<span id="L1171" class="LineNr">1171 </span><span class="Constant">$get-slice-or-stop:search-loop</span>: -<span id="L1172" class="LineNr">1172 </span> <span class="subxComment"># if (curr >= max) stop(ed)</span> -<span id="L1173" class="LineNr">1173 </span> 39/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ecx with edx</span> -<span id="L1174" class="LineNr">1174 </span> 73/jump-if-greater-or-equal-unsigned $get-slice-or-stop:<a href='059stop.subx.html#L92'>stop</a>/disp8 -<span id="L1175" class="LineNr">1175 </span> <span class="subxComment"># if (slice-equal?(key, *curr)) return curr+4</span> -<span id="L1176" class="LineNr">1176 </span> <span class="subxS1Comment"># . eax = slice-equal?(key, *curr)</span> -<span id="L1177" class="LineNr">1177 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1178" class="LineNr">1178 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> -<span id="L1179" class="LineNr">1179 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> -<span id="L1180" class="LineNr">1180 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1181" class="LineNr">1181 </span> e8/call <a href='072slice.subx.html#L91'>slice-equal?</a>/disp32 -<span id="L1182" class="LineNr">1182 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1183" class="LineNr">1183 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1184" class="LineNr">1184 </span> <span class="subxS1Comment"># . if (eax != 0) return eax = curr+4</span> -<span id="L1185" class="LineNr">1185 </span> 3d/compare-eax-and 0/imm32 -<span id="L1186" class="LineNr">1186 </span> 74/jump-if-equal $get-slice-or-stop:mismatch/disp8 -<span id="L1187" class="LineNr">1187 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+4 to eax</span> -<span id="L1188" class="LineNr">1188 </span> eb/jump $get-slice-or-stop:end/disp8 -<span id="L1189" class="LineNr">1189 </span><span class="Constant">$get-slice-or-stop:mismatch</span>: -<span id="L1190" class="LineNr">1190 </span> <span class="subxComment"># curr += row-size</span> -<span id="L1191" class="LineNr">1191 </span> 03/add 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># add *(ebp+16) to ecx</span> -<span id="L1192" class="LineNr">1192 </span> <span class="subxComment"># loop</span> -<span id="L1193" class="LineNr">1193 </span> eb/jump $get-slice-or-stop:search-loop/disp8 -<span id="L1194" class="LineNr">1194 </span><span class="Constant">$get-slice-or-stop:end</span>: -<span id="L1195" class="LineNr">1195 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L1196" class="LineNr">1196 </span> 5e/pop-to-esi -<span id="L1197" class="LineNr">1197 </span> 5a/pop-to-edx -<span id="L1198" class="LineNr">1198 </span> 59/pop-to-ecx -<span id="L1199" class="LineNr">1199 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1200" class="LineNr">1200 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> -<span id="L1201" class="LineNr">1201 </span> 5d/pop-to-ebp -<span id="L1202" class="LineNr">1202 </span> c3/return -<span id="L1203" class="LineNr">1203 </span> -<span id="L1204" class="LineNr">1204 </span><span class="Constant">$get-slice-or-stop:<a href='059stop.subx.html#L92'>stop</a></span>: -<span id="L1205" class="LineNr">1205 </span> <span class="subxS1Comment"># . write-buffered(err, abort-message-prefix)</span> -<span id="L1206" class="LineNr">1206 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1207" class="LineNr">1207 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x14/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+20)</span> -<span id="L1208" class="LineNr">1208 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> -<span id="L1209" class="LineNr">1209 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1210" class="LineNr">1210 </span> e8/call <a href='065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L1211" class="LineNr">1211 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1212" class="LineNr">1212 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1213" class="LineNr">1213 </span> <span class="subxS1Comment"># . write-buffered(err, error)</span> -<span id="L1214" class="LineNr">1214 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1215" class="LineNr">1215 </span> 68/push <span class="Constant">": <a href='081table.subx.html#L1144'>get-slice-or-stop</a>: key not found: "</span>/imm32 -<span id="L1216" class="LineNr">1216 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> -<span id="L1217" class="LineNr">1217 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1218" class="LineNr">1218 </span> e8/call <a href='065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L1219" class="LineNr">1219 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1220" class="LineNr">1220 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1221" class="LineNr">1221 </span> <span class="subxS1Comment"># . write-slice-buffered(err, key)</span> -<span id="L1222" class="LineNr">1222 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1223" class="LineNr">1223 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> -<span id="L1224" class="LineNr">1224 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> -<span id="L1225" class="LineNr">1225 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1226" class="LineNr">1226 </span> e8/call <a href='072slice.subx.html#L878'>write-slice-buffered</a>/disp32 -<span id="L1227" class="LineNr">1227 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1228" class="LineNr">1228 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1229" class="LineNr">1229 </span> <span class="subxS1Comment"># . write-buffered(err, "\n")</span> -<span id="L1230" class="LineNr">1230 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1231" class="LineNr">1231 </span> 68/push <span class="SpecialChar"><a href='051test.subx.html#L83'>Newline</a></span>/imm32 -<span id="L1232" class="LineNr">1232 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> -<span id="L1233" class="LineNr">1233 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1234" class="LineNr">1234 </span> e8/call <a href='065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L1235" class="LineNr">1235 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1236" class="LineNr">1236 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1237" class="LineNr">1237 </span> <span class="subxS1Comment"># . stop(ed, 1)</span> -<span id="L1238" class="LineNr">1238 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1239" class="LineNr">1239 </span> 68/push 1/imm32 -<span id="L1240" class="LineNr">1240 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x1c/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+28)</span> -<span id="L1241" class="LineNr">1241 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1242" class="LineNr">1242 </span> e8/call <a href='059stop.subx.html#L92'>stop</a>/disp32 -<span id="L1243" class="LineNr">1243 </span> <span class="subxComment"># never gets here</span> -<span id="L1244" class="LineNr">1244 </span><span class="Constant">$get-slice-or-stop:terminus</span>: -<span id="L1245" class="LineNr">1245 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1246" class="LineNr">1246 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1247" class="LineNr">1247 </span> <span class="subxComment"># syscall(exit, 1)</span> -<span id="L1248" class="LineNr">1248 </span> b8/copy-to-eax 1/imm32/exit -<span id="L1249" class="LineNr">1249 </span> cd/syscall 0x80/imm8 -<span id="L1250" class="LineNr">1250 </span> -<span id="L1251" class="LineNr">1251 </span><span class="subxTest">test-get-slice-or-stop</span>: -<span id="L1252" class="LineNr">1252 </span> <span class="subxComment"># This test uses exit-descriptors. Use ebp for setting up local variables.</span> -<span id="L1253" class="LineNr">1253 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1254" class="LineNr">1254 </span> 55/push-ebp -<span id="L1255" class="LineNr">1255 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> -<span id="L1256" class="LineNr">1256 </span> <span class="subxComment"># setup</span> -<span id="L1257" class="LineNr">1257 </span> <span class="subxS1Comment"># . clear-stream(_test-error-stream)</span> -<span id="L1258" class="LineNr">1258 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1259" class="LineNr">1259 </span> 68/push <a href='064write-byte.subx.html#L344'>_test-error-stream</a>/imm32 -<span id="L1260" class="LineNr">1260 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1261" class="LineNr">1261 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L1262" class="LineNr">1262 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1263" class="LineNr">1263 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> -<span id="L1264" class="LineNr">1264 </span> <span class="subxS1Comment"># . clear-stream(_test-error-buffered-file+4)</span> -<span id="L1265" class="LineNr">1265 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1266" class="LineNr">1266 </span> b8/copy-to-eax <a href='064write-byte.subx.html#L362'>_test-error-buffered-file</a>/imm32 -<span id="L1267" class="LineNr">1267 </span> 05/add-to-eax 4/imm32 -<span id="L1268" class="LineNr">1268 </span> 50/push-eax -<span id="L1269" class="LineNr">1269 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1270" class="LineNr">1270 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L1271" class="LineNr">1271 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1272" class="LineNr">1272 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> -<span id="L1273" class="LineNr">1273 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> -<span id="L1274" class="LineNr">1274 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> -<span id="L1275" class="LineNr">1275 </span> 68/push 0x10/imm32/length -<span id="L1276" class="LineNr">1276 </span> 68/push 0/imm32/read -<span id="L1277" class="LineNr">1277 </span> 68/push 0/imm32/write -<span id="L1278" class="LineNr">1278 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> -<span id="L1279" class="LineNr">1279 </span> <span class="subxComment"># var ed/edx : (address exit-descriptor)</span> -<span id="L1280" class="LineNr">1280 </span> 68/push 0/imm32 -<span id="L1281" class="LineNr">1281 </span> 68/push 0/imm32 -<span id="L1282" class="LineNr">1282 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> -<span id="L1283" class="LineNr">1283 </span> <span class="subxComment"># var slice/ebx = "code"</span> -<span id="L1284" class="LineNr">1284 </span> <span class="subxS1Comment"># . (eax..ebx) = "code"</span> -<span id="L1285" class="LineNr">1285 </span> b8/copy-to-eax <span class="Constant">"code"</span>/imm32 -<span id="L1286" class="LineNr">1286 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to ebx</span> -<span id="L1287" class="LineNr">1287 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 3/index/ebx <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ebx+4 to ebx</span> -<span id="L1288" class="LineNr">1288 </span> 05/add-to-eax 4/imm32 -<span id="L1289" class="LineNr">1289 </span> <span class="subxS1Comment"># . ebx = {eax, ebx}</span> -<span id="L1290" class="LineNr">1290 </span> 53/push-ebx -<span id="L1291" class="LineNr">1291 </span> 50/push-eax -<span id="L1292" class="LineNr">1292 </span> 89/copy 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebx</span> -<span id="L1293" class="LineNr">1293 </span> <span class="subxComment"># size 'ed' for the calls to 'get-or-stop' (define no locals past this point)</span> -<span id="L1294" class="LineNr">1294 </span> <span class="subxS1Comment"># . tailor-exit-descriptor(ed, 24)</span> -<span id="L1295" class="LineNr">1295 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1296" class="LineNr">1296 </span> 68/push 0x18/imm32/nbytes-of-args-for-get-or-stop -<span id="L1297" class="LineNr">1297 </span> 52/push-edx -<span id="L1298" class="LineNr">1298 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1299" class="LineNr">1299 </span> e8/call <a href='059stop.subx.html#L44'>tailor-exit-descriptor</a>/disp32 -<span id="L1300" class="LineNr">1300 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1301" class="LineNr">1301 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1302" class="LineNr">1302 </span> <span class="subxComment"># insert(table, "code", 8 bytes per row)</span> -<span id="L1303" class="LineNr">1303 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1304" class="LineNr">1304 </span> 68/push 8/imm32/row-size -<span id="L1305" class="LineNr">1305 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1306" class="LineNr">1306 </span> 51/push-ecx -<span id="L1307" class="LineNr">1307 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1308" class="LineNr">1308 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 -<span id="L1309" class="LineNr">1309 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1310" class="LineNr">1310 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1311" class="LineNr">1311 </span><span class="Constant">$test-get-slice-or-stop:success</span>: -<span id="L1312" class="LineNr">1312 </span> <span class="subxComment"># eax = get-slice-or-stop(table, slice, row-size=8, msg, _test-error-buffered-file, ed)</span> -<span id="L1313" class="LineNr">1313 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1314" class="LineNr">1314 </span> 52/push-edx/ed -<span id="L1315" class="LineNr">1315 </span> 68/push <a href='064write-byte.subx.html#L362'>_test-error-buffered-file</a>/imm32 -<span id="L1316" class="LineNr">1316 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix -<span id="L1317" class="LineNr">1317 </span> 68/push 8/imm32/row-size -<span id="L1318" class="LineNr">1318 </span> 53/push-ebx/slice -<span id="L1319" class="LineNr">1319 </span> 51/push-ecx -<span id="L1320" class="LineNr">1320 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1321" class="LineNr">1321 </span> e8/call <a href='081table.subx.html#L1144'>get-slice-or-stop</a>/disp32 -<span id="L1322" class="LineNr">1322 </span> <span class="subxComment"># registers except esp may be clobbered at this point</span> -<span id="L1323" class="LineNr">1323 </span> <span class="subxComment"># restore register args, discard others</span> -<span id="L1324" class="LineNr">1324 </span> 59/pop-to-ecx -<span id="L1325" class="LineNr">1325 </span> 5b/pop-to-ebx -<span id="L1326" class="LineNr">1326 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1327" class="LineNr">1327 </span> 5a/pop-to-edx -<span id="L1328" class="LineNr">1328 </span><span class="Constant">$test-get-slice-or-stop:success-assertion</span>: -<span id="L1329" class="LineNr">1329 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg) # first row's value slot returned</span> -<span id="L1330" class="LineNr">1330 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> -<span id="L1331" class="LineNr">1331 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1332" class="LineNr">1332 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1251'>test-get-slice-or-stop</a>/0"</span>/imm32 -<span id="L1333" class="LineNr">1333 </span> 68/push 0x10/imm32 -<span id="L1334" class="LineNr">1334 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> -<span id="L1335" class="LineNr">1335 </span> 50/push-eax -<span id="L1336" class="LineNr">1336 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1337" class="LineNr">1337 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1338" class="LineNr">1338 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1339" class="LineNr">1339 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1340" class="LineNr">1340 </span><span class="Constant">$test-get-slice-or-stop:failure</span>: -<span id="L1341" class="LineNr">1341 </span> <span class="subxComment"># slice = "segment2"</span> -<span id="L1342" class="LineNr">1342 </span> <span class="subxS1Comment"># . *ebx = "segment2"->data</span> -<span id="L1343" class="LineNr">1343 </span> b8/copy-to-eax <span class="Constant">"segment2"</span>/imm32 -<span id="L1344" class="LineNr">1344 </span> 05/add-to-eax 4/imm32 -<span id="L1345" class="LineNr">1345 </span> 89/copy 0/mod/indirect 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to *ebx</span> -<span id="L1346" class="LineNr">1346 </span> <span class="subxS1Comment"># . *(ebx+4) = "segment2"->data + len("segment2")</span> -<span id="L1347" class="LineNr">1347 </span> 05/add-to-eax 8/imm32/strlen -<span id="L1348" class="LineNr">1348 </span> 89/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(ebx+4)</span> -<span id="L1349" class="LineNr">1349 </span> <span class="subxComment"># eax = get-slice-or-stop(table, slice, row-size=8, msg, _test-error-buffered-file, ed)</span> -<span id="L1350" class="LineNr">1350 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1351" class="LineNr">1351 </span> 52/push-edx/ed -<span id="L1352" class="LineNr">1352 </span> 68/push <a href='064write-byte.subx.html#L362'>_test-error-buffered-file</a>/imm32 -<span id="L1353" class="LineNr">1353 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix -<span id="L1354" class="LineNr">1354 </span> 68/push 8/imm32/row-size -<span id="L1355" class="LineNr">1355 </span> 53/push-ebx/slice -<span id="L1356" class="LineNr">1356 </span> 51/push-ecx -<span id="L1357" class="LineNr">1357 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1358" class="LineNr">1358 </span> e8/call <a href='081table.subx.html#L1144'>get-slice-or-stop</a>/disp32 -<span id="L1359" class="LineNr">1359 </span> <span class="subxComment"># registers except esp may be clobbered at this point</span> -<span id="L1360" class="LineNr">1360 </span> <span class="subxComment"># restore register args, discard others</span> -<span id="L1361" class="LineNr">1361 </span> 59/pop-to-ecx -<span id="L1362" class="LineNr">1362 </span> 5b/pop-to-ebx -<span id="L1363" class="LineNr">1363 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1364" class="LineNr">1364 </span> 5a/pop-to-edx -<span id="L1365" class="LineNr">1365 </span><span class="Constant">$test-get-slice-or-stop:failure-assertion</span>: -<span id="L1366" class="LineNr">1366 </span> <span class="subxComment"># check that get-or-stop tried to call stop(1)</span> -<span id="L1367" class="LineNr">1367 </span> <span class="subxS1Comment"># . check-ints-equal(ed->value, 2, msg)</span> -<span id="L1368" class="LineNr">1368 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1369" class="LineNr">1369 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1033'>test-get-or-stop</a>/1"</span>/imm32 -<span id="L1370" class="LineNr">1370 </span> 68/push 2/imm32 -<span id="L1371" class="LineNr">1371 </span> <span class="subxS2Comment"># . . push ed->value</span> -<span id="L1372" class="LineNr">1372 </span> ff 6/subop/push 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(edx+4)</span> -<span id="L1373" class="LineNr">1373 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1374" class="LineNr">1374 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1375" class="LineNr">1375 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1376" class="LineNr">1376 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1377" class="LineNr">1377 </span><span class="Constant">$test-get-slice-or-stop:end</span>: -<span id="L1378" class="LineNr">1378 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1379" class="LineNr">1379 </span> <span class="subxComment"># don't restore esp from ebp; manually reclaim locals</span> -<span id="L1380" class="LineNr">1380 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x2c/imm32 <span class="subxComment"># add to esp</span> -<span id="L1381" class="LineNr">1381 </span> 5d/pop-to-ebp -<span id="L1382" class="LineNr">1382 </span> c3/return -<span id="L1383" class="LineNr">1383 </span> -<span id="L1384" class="LineNr">1384 </span><span class="subxComment"># if no row is found, return null (0)</span> -<span id="L1385" class="LineNr">1385 </span><span class="subxFunction">maybe-get</span>: <span class="subxComment"># table : (address stream {string, _}), key : (address string), row-size : int -> eax : (address _)</span> -<span id="L1386" class="LineNr">1386 </span> <span class="subxComment"># pseudocode:</span> -<span id="L1387" class="LineNr">1387 </span> <span class="subxComment"># curr = table->data</span> -<span id="L1388" class="LineNr">1388 </span> <span class="subxComment"># max = &table->data[table->write]</span> -<span id="L1389" class="LineNr">1389 </span> <span class="subxComment"># while curr < max</span> -<span id="L1390" class="LineNr">1390 </span> <span class="subxComment"># if string-equal?(key, *curr)</span> -<span id="L1391" class="LineNr">1391 </span> <span class="subxComment"># return curr+4</span> -<span id="L1392" class="LineNr">1392 </span> <span class="subxComment"># curr += row-size</span> -<span id="L1393" class="LineNr">1393 </span> <span class="subxComment"># return 0</span> -<span id="L1394" class="LineNr">1394 </span> <span class="subxComment">#</span> -<span id="L1395" class="LineNr">1395 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1396" class="LineNr">1396 </span> 55/push-ebp -<span id="L1397" class="LineNr">1397 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> -<span id="L1398" class="LineNr">1398 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L1399" class="LineNr">1399 </span> 51/push-ecx -<span id="L1400" class="LineNr">1400 </span> 52/push-edx -<span id="L1401" class="LineNr">1401 </span> 56/push-esi -<span id="L1402" class="LineNr">1402 </span> <span class="subxComment"># esi = table</span> -<span id="L1403" class="LineNr">1403 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L1404" class="LineNr">1404 </span> <span class="subxComment"># curr/ecx = table->data</span> -<span id="L1405" class="LineNr">1405 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L1406" class="LineNr">1406 </span> <span class="subxComment"># max/edx = table->data + table->write</span> -<span id="L1407" class="LineNr">1407 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L1408" class="LineNr">1408 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> -<span id="L1409" class="LineNr">1409 </span><span class="Constant">$maybe-get:search-loop</span>: -<span id="L1410" class="LineNr">1410 </span> <span class="subxComment"># if (curr >= max) return null</span> -<span id="L1411" class="LineNr">1411 </span> 39/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ecx with edx</span> -<span id="L1412" class="LineNr">1412 </span> 73/jump-if-greater-or-equal-unsigned $maybe-get:null/disp8 -<span id="L1413" class="LineNr">1413 </span> <span class="subxComment"># if (string-equal?(key, *curr)) return curr+4</span> -<span id="L1414" class="LineNr">1414 </span> <span class="subxS1Comment"># . eax = string-equal?(key, *curr)</span> -<span id="L1415" class="LineNr">1415 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1416" class="LineNr">1416 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> -<span id="L1417" class="LineNr">1417 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> -<span id="L1418" class="LineNr">1418 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1419" class="LineNr">1419 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal?</a>/disp32 -<span id="L1420" class="LineNr">1420 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1421" class="LineNr">1421 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1422" class="LineNr">1422 </span> <span class="subxS1Comment"># . if (eax != 0) return eax = curr+4</span> -<span id="L1423" class="LineNr">1423 </span> 3d/compare-eax-and 0/imm32 -<span id="L1424" class="LineNr">1424 </span> 74/jump-if-equal $maybe-get:mismatch/disp8 -<span id="L1425" class="LineNr">1425 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+4 to eax</span> -<span id="L1426" class="LineNr">1426 </span> eb/jump $maybe-get:end/disp8 -<span id="L1427" class="LineNr">1427 </span><span class="Constant">$maybe-get:mismatch</span>: -<span id="L1428" class="LineNr">1428 </span> <span class="subxComment"># curr += row-size</span> -<span id="L1429" class="LineNr">1429 </span> 03/add 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># add *(ebp+16) to ecx</span> -<span id="L1430" class="LineNr">1430 </span> <span class="subxComment"># loop</span> -<span id="L1431" class="LineNr">1431 </span> eb/jump $maybe-get:search-loop/disp8 -<span id="L1432" class="LineNr">1432 </span><span class="Constant">$maybe-get:null</span>: -<span id="L1433" class="LineNr">1433 </span> b8/copy-to-eax 0/imm32 -<span id="L1434" class="LineNr">1434 </span><span class="Constant">$maybe-get:end</span>: -<span id="L1435" class="LineNr">1435 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L1436" class="LineNr">1436 </span> 5e/pop-to-esi -<span id="L1437" class="LineNr">1437 </span> 5a/pop-to-edx -<span id="L1438" class="LineNr">1438 </span> 59/pop-to-ecx -<span id="L1439" class="LineNr">1439 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1440" class="LineNr">1440 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> -<span id="L1441" class="LineNr">1441 </span> 5d/pop-to-ebp -<span id="L1442" class="LineNr">1442 </span> c3/return -<span id="L1443" class="LineNr">1443 </span> -<span id="L1444" class="LineNr">1444 </span><span class="subxTest">test-maybe-get</span>: -<span id="L1445" class="LineNr">1445 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1446" class="LineNr">1446 </span> 55/push-ebp -<span id="L1447" class="LineNr">1447 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> -<span id="L1448" class="LineNr">1448 </span> <span class="subxH1Comment"># - setup: create a table with one row</span> -<span id="L1449" class="LineNr">1449 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> -<span id="L1450" class="LineNr">1450 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> -<span id="L1451" class="LineNr">1451 </span> 68/push 0x10/imm32/length -<span id="L1452" class="LineNr">1452 </span> 68/push 0/imm32/read -<span id="L1453" class="LineNr">1453 </span> 68/push 0/imm32/write -<span id="L1454" class="LineNr">1454 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> -<span id="L1455" class="LineNr">1455 </span> <span class="subxComment"># eax = get-or-insert(table, "code", 8 bytes per row)</span> -<span id="L1456" class="LineNr">1456 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1457" class="LineNr">1457 </span> 68/push 8/imm32/row-size -<span id="L1458" class="LineNr">1458 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1459" class="LineNr">1459 </span> 51/push-ecx -<span id="L1460" class="LineNr">1460 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1461" class="LineNr">1461 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 -<span id="L1462" class="LineNr">1462 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1463" class="LineNr">1463 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1464" class="LineNr">1464 </span><span class="Constant">$test-maybe-get:success</span>: -<span id="L1465" class="LineNr">1465 </span> <span class="subxH1Comment"># - check for the same key, verify that it was reused</span> -<span id="L1466" class="LineNr">1466 </span> <span class="subxComment"># eax = maybe-get(table, "code", 8 bytes per row)</span> -<span id="L1467" class="LineNr">1467 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1468" class="LineNr">1468 </span> 68/push 8/imm32/row-size -<span id="L1469" class="LineNr">1469 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1470" class="LineNr">1470 </span> 51/push-ecx -<span id="L1471" class="LineNr">1471 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1472" class="LineNr">1472 </span> e8/call <a href='081table.subx.html#L1385'>maybe-get</a>/disp32 -<span id="L1473" class="LineNr">1473 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1474" class="LineNr">1474 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1475" class="LineNr">1475 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg)</span> -<span id="L1476" class="LineNr">1476 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> -<span id="L1477" class="LineNr">1477 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1478" class="LineNr">1478 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1444'>test-maybe-get</a>/0"</span>/imm32 -<span id="L1479" class="LineNr">1479 </span> 68/push 0x10/imm32 -<span id="L1480" class="LineNr">1480 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> -<span id="L1481" class="LineNr">1481 </span> 50/push-eax -<span id="L1482" class="LineNr">1482 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1483" class="LineNr">1483 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1484" class="LineNr">1484 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1485" class="LineNr">1485 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1486" class="LineNr">1486 </span> <span class="subxComment"># no new row inserted</span> -<span id="L1487" class="LineNr">1487 </span> <span class="subxS1Comment"># . check-ints-equal(table->write, row-size = 8, msg)</span> -<span id="L1488" class="LineNr">1488 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1489" class="LineNr">1489 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1444'>test-maybe-get</a>/1"</span>/imm32 -<span id="L1490" class="LineNr">1490 </span> 68/push 8/imm32/row-size -<span id="L1491" class="LineNr">1491 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> -<span id="L1492" class="LineNr">1492 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1493" class="LineNr">1493 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1494" class="LineNr">1494 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1495" class="LineNr">1495 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1496" class="LineNr">1496 </span> <span class="subxComment"># check-string-equal(*table->data, "code", msg)</span> -<span id="L1497" class="LineNr">1497 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1498" class="LineNr">1498 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1444'>test-maybe-get</a>/2"</span>/imm32 -<span id="L1499" class="LineNr">1499 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1500" class="LineNr">1500 </span> ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ecx+12)</span> -<span id="L1501" class="LineNr">1501 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1502" class="LineNr">1502 </span> e8/call <a href='054string-equal.subx.html#L178'>check-string-equal</a>/disp32 -<span id="L1503" class="LineNr">1503 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1504" class="LineNr">1504 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1505" class="LineNr">1505 </span><span class="Constant">$test-maybe-get:failure</span>: -<span id="L1506" class="LineNr">1506 </span> <span class="subxH1Comment"># - search for a new key</span> -<span id="L1507" class="LineNr">1507 </span> <span class="subxComment"># eax = maybe-get(table, "data", 8 bytes per row)</span> -<span id="L1508" class="LineNr">1508 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1509" class="LineNr">1509 </span> 68/push 8/imm32/row-size -<span id="L1510" class="LineNr">1510 </span> 68/push <span class="Constant">"data"</span>/imm32 -<span id="L1511" class="LineNr">1511 </span> 51/push-ecx -<span id="L1512" class="LineNr">1512 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1513" class="LineNr">1513 </span> e8/call <a href='081table.subx.html#L1385'>maybe-get</a>/disp32 -<span id="L1514" class="LineNr">1514 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1515" class="LineNr">1515 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1516" class="LineNr">1516 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span> -<span id="L1517" class="LineNr">1517 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1518" class="LineNr">1518 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1444'>test-maybe-get</a>/3"</span>/imm32 -<span id="L1519" class="LineNr">1519 </span> 68/push 0/imm32 -<span id="L1520" class="LineNr">1520 </span> 50/push-eax -<span id="L1521" class="LineNr">1521 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1522" class="LineNr">1522 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1523" class="LineNr">1523 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1524" class="LineNr">1524 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1525" class="LineNr">1525 </span><span class="Constant">$test-maybe-get:end</span>: -<span id="L1526" class="LineNr">1526 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1527" class="LineNr">1527 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> -<span id="L1528" class="LineNr">1528 </span> 5d/pop-to-ebp -<span id="L1529" class="LineNr">1529 </span> c3/return -<span id="L1530" class="LineNr">1530 </span> -<span id="L1531" class="LineNr">1531 </span><span class="subxComment"># if no row is found, return null (0)</span> -<span id="L1532" class="LineNr">1532 </span><span class="subxFunction">maybe-get-slice</span>: <span class="subxComment"># table : (address stream {string, _}), key : (address slice), row-size : int -> eax : (address _)</span> -<span id="L1533" class="LineNr">1533 </span> <span class="subxComment"># pseudocode:</span> -<span id="L1534" class="LineNr">1534 </span> <span class="subxComment"># curr = table->data</span> -<span id="L1535" class="LineNr">1535 </span> <span class="subxComment"># max = &table->data[table->write]</span> -<span id="L1536" class="LineNr">1536 </span> <span class="subxComment"># while curr < max</span> -<span id="L1537" class="LineNr">1537 </span> <span class="subxComment"># if slice-equal?(key, *curr)</span> -<span id="L1538" class="LineNr">1538 </span> <span class="subxComment"># return curr+4</span> -<span id="L1539" class="LineNr">1539 </span> <span class="subxComment"># curr += row-size</span> -<span id="L1540" class="LineNr">1540 </span> <span class="subxComment"># return 0</span> -<span id="L1541" class="LineNr">1541 </span> <span class="subxComment">#</span> -<span id="L1542" class="LineNr">1542 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1543" class="LineNr">1543 </span> 55/push-ebp -<span id="L1544" class="LineNr">1544 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> -<span id="L1545" class="LineNr">1545 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L1546" class="LineNr">1546 </span> 51/push-ecx -<span id="L1547" class="LineNr">1547 </span> 52/push-edx -<span id="L1548" class="LineNr">1548 </span> 56/push-esi -<span id="L1549" class="LineNr">1549 </span> <span class="subxComment"># esi = table</span> -<span id="L1550" class="LineNr">1550 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L1551" class="LineNr">1551 </span> <span class="subxComment"># curr/ecx = table->data</span> -<span id="L1552" class="LineNr">1552 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L1553" class="LineNr">1553 </span> <span class="subxComment"># max/edx = table->data + table->write</span> -<span id="L1554" class="LineNr">1554 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L1555" class="LineNr">1555 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> -<span id="L1556" class="LineNr">1556 </span><span class="Constant">$maybe-get-slice:search-loop</span>: -<span id="L1557" class="LineNr">1557 </span> <span class="subxComment"># if (curr >= max) return null</span> -<span id="L1558" class="LineNr">1558 </span> 39/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ecx with edx</span> -<span id="L1559" class="LineNr">1559 </span> 73/jump-if-greater-or-equal-unsigned $maybe-get-slice:null/disp8 -<span id="L1560" class="LineNr">1560 </span> <span class="subxComment"># if (slice-equal?(key, *curr)) return curr+4</span> -<span id="L1561" class="LineNr">1561 </span> <span class="subxS1Comment"># . eax = slice-equal?(key, *curr)</span> -<span id="L1562" class="LineNr">1562 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1563" class="LineNr">1563 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> -<span id="L1564" class="LineNr">1564 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> -<span id="L1565" class="LineNr">1565 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1566" class="LineNr">1566 </span> e8/call <a href='072slice.subx.html#L91'>slice-equal?</a>/disp32 -<span id="L1567" class="LineNr">1567 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1568" class="LineNr">1568 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1569" class="LineNr">1569 </span> <span class="subxS1Comment"># . if (eax != 0) return eax = curr+4</span> -<span id="L1570" class="LineNr">1570 </span> 3d/compare-eax-and 0/imm32 -<span id="L1571" class="LineNr">1571 </span> 74/jump-if-equal $maybe-get-slice:mismatch/disp8 -<span id="L1572" class="LineNr">1572 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+4 to eax</span> -<span id="L1573" class="LineNr">1573 </span> eb/jump $maybe-get-slice:end/disp8 -<span id="L1574" class="LineNr">1574 </span><span class="Constant">$maybe-get-slice:mismatch</span>: -<span id="L1575" class="LineNr">1575 </span> <span class="subxComment"># curr += row-size</span> -<span id="L1576" class="LineNr">1576 </span> 03/add 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># add *(ebp+16) to ecx</span> -<span id="L1577" class="LineNr">1577 </span> <span class="subxComment"># loop</span> -<span id="L1578" class="LineNr">1578 </span> eb/jump $maybe-get-slice:search-loop/disp8 -<span id="L1579" class="LineNr">1579 </span><span class="Constant">$maybe-get-slice:null</span>: -<span id="L1580" class="LineNr">1580 </span> b8/copy-to-eax 0/imm32 -<span id="L1581" class="LineNr">1581 </span><span class="Constant">$maybe-get-slice:end</span>: -<span id="L1582" class="LineNr">1582 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L1583" class="LineNr">1583 </span> 5e/pop-to-esi -<span id="L1584" class="LineNr">1584 </span> 5a/pop-to-edx -<span id="L1585" class="LineNr">1585 </span> 59/pop-to-ecx -<span id="L1586" class="LineNr">1586 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1587" class="LineNr">1587 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> -<span id="L1588" class="LineNr">1588 </span> 5d/pop-to-ebp -<span id="L1589" class="LineNr">1589 </span> c3/return -<span id="L1590" class="LineNr">1590 </span> -<span id="L1591" class="LineNr">1591 </span><span class="subxTest">test-maybe-get-slice</span>: -<span id="L1592" class="LineNr">1592 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1593" class="LineNr">1593 </span> 55/push-ebp -<span id="L1594" class="LineNr">1594 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> -<span id="L1595" class="LineNr">1595 </span> <span class="subxH1Comment"># - setup: create a table with one row</span> -<span id="L1596" class="LineNr">1596 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> -<span id="L1597" class="LineNr">1597 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> -<span id="L1598" class="LineNr">1598 </span> 68/push 0x10/imm32/length -<span id="L1599" class="LineNr">1599 </span> 68/push 0/imm32/read -<span id="L1600" class="LineNr">1600 </span> 68/push 0/imm32/write -<span id="L1601" class="LineNr">1601 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> -<span id="L1602" class="LineNr">1602 </span> <span class="subxComment"># insert(table, "code", 8 bytes per row)</span> -<span id="L1603" class="LineNr">1603 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1604" class="LineNr">1604 </span> 68/push 8/imm32/row-size -<span id="L1605" class="LineNr">1605 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1606" class="LineNr">1606 </span> 51/push-ecx -<span id="L1607" class="LineNr">1607 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1608" class="LineNr">1608 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 -<span id="L1609" class="LineNr">1609 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1610" class="LineNr">1610 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1611" class="LineNr">1611 </span><span class="Constant">$test-maybe-get-slice:success</span>: -<span id="L1612" class="LineNr">1612 </span> <span class="subxH1Comment"># - check for the same key, verify that it was reused</span> -<span id="L1613" class="LineNr">1613 </span> <span class="subxComment"># (eax..edx) = "code"</span> -<span id="L1614" class="LineNr">1614 </span> b8/copy-to-eax <span class="Constant">"code"</span>/imm32 -<span id="L1615" class="LineNr">1615 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to edx</span> -<span id="L1616" class="LineNr">1616 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 2/index/edx <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+edx+4 to edx</span> -<span id="L1617" class="LineNr">1617 </span> 05/add-to-eax 4/imm32 -<span id="L1618" class="LineNr">1618 </span> <span class="subxComment"># var slice/edx = {eax, edx}</span> -<span id="L1619" class="LineNr">1619 </span> 52/push-edx -<span id="L1620" class="LineNr">1620 </span> 50/push-eax -<span id="L1621" class="LineNr">1621 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> -<span id="L1622" class="LineNr">1622 </span> <span class="subxComment"># eax = maybe-get-slice(table, "code" slice, 8 bytes per row)</span> -<span id="L1623" class="LineNr">1623 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1624" class="LineNr">1624 </span> 68/push 8/imm32/row-size -<span id="L1625" class="LineNr">1625 </span> 52/push-edx -<span id="L1626" class="LineNr">1626 </span> 51/push-ecx -<span id="L1627" class="LineNr">1627 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1628" class="LineNr">1628 </span> e8/call <a href='081table.subx.html#L1532'>maybe-get-slice</a>/disp32 -<span id="L1629" class="LineNr">1629 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1630" class="LineNr">1630 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1631" class="LineNr">1631 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg)</span> -<span id="L1632" class="LineNr">1632 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> -<span id="L1633" class="LineNr">1633 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1634" class="LineNr">1634 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1591'>test-maybe-get-slice</a>/0"</span>/imm32 -<span id="L1635" class="LineNr">1635 </span> 68/push 0x10/imm32 -<span id="L1636" class="LineNr">1636 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> -<span id="L1637" class="LineNr">1637 </span> 50/push-eax -<span id="L1638" class="LineNr">1638 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1639" class="LineNr">1639 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1640" class="LineNr">1640 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1641" class="LineNr">1641 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1642" class="LineNr">1642 </span> <span class="subxComment"># no new row inserted</span> -<span id="L1643" class="LineNr">1643 </span> <span class="subxS1Comment"># . check-ints-equal(table->write, row-size = 8, msg)</span> -<span id="L1644" class="LineNr">1644 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1645" class="LineNr">1645 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1591'>test-maybe-get-slice</a>/1"</span>/imm32 -<span id="L1646" class="LineNr">1646 </span> 68/push 8/imm32/row-size -<span id="L1647" class="LineNr">1647 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> -<span id="L1648" class="LineNr">1648 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1649" class="LineNr">1649 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1650" class="LineNr">1650 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1651" class="LineNr">1651 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1652" class="LineNr">1652 </span> <span class="subxComment"># check-string-equal(*table->data, "code", msg)</span> -<span id="L1653" class="LineNr">1653 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1654" class="LineNr">1654 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1591'>test-maybe-get-slice</a>/2"</span>/imm32 -<span id="L1655" class="LineNr">1655 </span> 68/push <span class="Constant">"code"</span>/imm32 -<span id="L1656" class="LineNr">1656 </span> ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ecx+12)</span> -<span id="L1657" class="LineNr">1657 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1658" class="LineNr">1658 </span> e8/call <a href='054string-equal.subx.html#L178'>check-string-equal</a>/disp32 -<span id="L1659" class="LineNr">1659 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1660" class="LineNr">1660 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1661" class="LineNr">1661 </span><span class="Constant">$test-maybe-get-slice:failure</span>: -<span id="L1662" class="LineNr">1662 </span> <span class="subxH1Comment"># - search for a new key</span> -<span id="L1663" class="LineNr">1663 </span> <span class="subxComment"># (eax..edx) = "data"</span> -<span id="L1664" class="LineNr">1664 </span> b8/copy-to-eax <span class="Constant">"data"</span>/imm32 -<span id="L1665" class="LineNr">1665 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to edx</span> -<span id="L1666" class="LineNr">1666 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 2/index/edx <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+edx+4 to edx</span> -<span id="L1667" class="LineNr">1667 </span> 05/add-to-eax 4/imm32 -<span id="L1668" class="LineNr">1668 </span> <span class="subxComment"># var slice/edx = {eax, edx}</span> -<span id="L1669" class="LineNr">1669 </span> 52/push-edx -<span id="L1670" class="LineNr">1670 </span> 50/push-eax -<span id="L1671" class="LineNr">1671 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> -<span id="L1672" class="LineNr">1672 </span> <span class="subxComment"># eax = maybe-get-slice(table, "data" slice, 8 bytes per row)</span> -<span id="L1673" class="LineNr">1673 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1674" class="LineNr">1674 </span> 68/push 8/imm32/row-size -<span id="L1675" class="LineNr">1675 </span> 52/push-edx -<span id="L1676" class="LineNr">1676 </span> 51/push-ecx -<span id="L1677" class="LineNr">1677 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1678" class="LineNr">1678 </span> e8/call <a href='081table.subx.html#L1532'>maybe-get-slice</a>/disp32 -<span id="L1679" class="LineNr">1679 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1680" class="LineNr">1680 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1681" class="LineNr">1681 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span> -<span id="L1682" class="LineNr">1682 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1683" class="LineNr">1683 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1591'>test-maybe-get-slice</a>/3"</span>/imm32 -<span id="L1684" class="LineNr">1684 </span> 68/push 0/imm32 -<span id="L1685" class="LineNr">1685 </span> 50/push-eax -<span id="L1686" class="LineNr">1686 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1687" class="LineNr">1687 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1688" class="LineNr">1688 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1689" class="LineNr">1689 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> -<span id="L1690" class="LineNr">1690 </span><span class="Constant">$test-maybe-get-slice:end</span>: -<span id="L1691" class="LineNr">1691 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1692" class="LineNr">1692 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> -<span id="L1693" class="LineNr">1693 </span> 5d/pop-to-ebp -<span id="L1694" class="LineNr">1694 </span> c3/return -<span id="L1695" class="LineNr">1695 </span> -<span id="L1696" class="LineNr">1696 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> +<span id="L1048" class="LineNr">1048 </span> 68/push <a href='064write-byte.subx.html#L362'>_test-error-buffered-file->buffer</a>/imm32 +<span id="L1049" class="LineNr">1049 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1050" class="LineNr">1050 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L1051" class="LineNr">1051 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1052" class="LineNr">1052 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> +<span id="L1053" class="LineNr">1053 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> +<span id="L1054" class="LineNr">1054 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> +<span id="L1055" class="LineNr">1055 </span> 68/push 0x10/imm32/length +<span id="L1056" class="LineNr">1056 </span> 68/push 0/imm32/read +<span id="L1057" class="LineNr">1057 </span> 68/push 0/imm32/write +<span id="L1058" class="LineNr">1058 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> +<span id="L1059" class="LineNr">1059 </span> <span class="subxComment"># var ed/edx : (address exit-descriptor)</span> +<span id="L1060" class="LineNr">1060 </span> 68/push 0/imm32 +<span id="L1061" class="LineNr">1061 </span> 68/push 0/imm32 +<span id="L1062" class="LineNr">1062 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> +<span id="L1063" class="LineNr">1063 </span> <span class="subxComment"># size 'ed' for the calls to 'get-or-stop'</span> +<span id="L1064" class="LineNr">1064 </span> <span class="subxS1Comment"># . tailor-exit-descriptor(ed, 24)</span> +<span id="L1065" class="LineNr">1065 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1066" class="LineNr">1066 </span> 68/push 0x18/imm32/nbytes-of-args-for-get-or-stop +<span id="L1067" class="LineNr">1067 </span> 52/push-edx +<span id="L1068" class="LineNr">1068 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1069" class="LineNr">1069 </span> e8/call <a href='059stop.subx.html#L44'>tailor-exit-descriptor</a>/disp32 +<span id="L1070" class="LineNr">1070 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1071" class="LineNr">1071 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1072" class="LineNr">1072 </span> <span class="subxComment"># insert(table, "code", 8 bytes per row)</span> +<span id="L1073" class="LineNr">1073 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1074" class="LineNr">1074 </span> 68/push 8/imm32/row-size +<span id="L1075" class="LineNr">1075 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1076" class="LineNr">1076 </span> 51/push-ecx +<span id="L1077" class="LineNr">1077 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1078" class="LineNr">1078 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 +<span id="L1079" class="LineNr">1079 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1080" class="LineNr">1080 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1081" class="LineNr">1081 </span><span class="Constant">$test-get-or-stop:success</span>: +<span id="L1082" class="LineNr">1082 </span> <span class="subxComment"># eax = get-or-stop(table, "code", row-size=8, msg, _test-error-buffered-file, ed)</span> +<span id="L1083" class="LineNr">1083 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1084" class="LineNr">1084 </span> 52/push-edx/ed +<span id="L1085" class="LineNr">1085 </span> 68/push <a href='064write-byte.subx.html#L359'>_test-error-buffered-file</a>/imm32 +<span id="L1086" class="LineNr">1086 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix +<span id="L1087" class="LineNr">1087 </span> 68/push 8/imm32/row-size +<span id="L1088" class="LineNr">1088 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1089" class="LineNr">1089 </span> 51/push-ecx +<span id="L1090" class="LineNr">1090 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1091" class="LineNr">1091 </span> e8/call <a href='081table.subx.html#L926'>get-or-stop</a>/disp32 +<span id="L1092" class="LineNr">1092 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1093" class="LineNr">1093 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/imm32 <span class="subxComment"># add to esp</span> +<span id="L1094" class="LineNr">1094 </span><span class="Constant">$test-get-or-stop:success-assertion</span>: +<span id="L1095" class="LineNr">1095 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg)</span> +<span id="L1096" class="LineNr">1096 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> +<span id="L1097" class="LineNr">1097 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1098" class="LineNr">1098 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1033'>test-get-or-stop</a>/0"</span>/imm32 +<span id="L1099" class="LineNr">1099 </span> 68/push 0x10/imm32 +<span id="L1100" class="LineNr">1100 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> +<span id="L1101" class="LineNr">1101 </span> 50/push-eax +<span id="L1102" class="LineNr">1102 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1103" class="LineNr">1103 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1104" class="LineNr">1104 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1105" class="LineNr">1105 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1106" class="LineNr">1106 </span><span class="Constant">$test-get-or-stop:failure</span>: +<span id="L1107" class="LineNr">1107 </span> <span class="subxComment"># eax = get-or-stop(table, "data", row-size=8, msg, _test-error-buffered-file, ed)</span> +<span id="L1108" class="LineNr">1108 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1109" class="LineNr">1109 </span> 52/push-edx/ed +<span id="L1110" class="LineNr">1110 </span> 68/push <a href='064write-byte.subx.html#L359'>_test-error-buffered-file</a>/imm32 +<span id="L1111" class="LineNr">1111 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix +<span id="L1112" class="LineNr">1112 </span> 68/push 8/imm32/row-size +<span id="L1113" class="LineNr">1113 </span> 68/push <span class="Constant">"data"</span>/imm32 +<span id="L1114" class="LineNr">1114 </span> 51/push-ecx +<span id="L1115" class="LineNr">1115 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1116" class="LineNr">1116 </span> e8/call <a href='081table.subx.html#L926'>get-or-stop</a>/disp32 +<span id="L1117" class="LineNr">1117 </span> <span class="subxComment"># registers except esp may be clobbered at this point</span> +<span id="L1118" class="LineNr">1118 </span> <span class="subxComment"># restore register args, discard others</span> +<span id="L1119" class="LineNr">1119 </span> 59/pop-to-ecx +<span id="L1120" class="LineNr">1120 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># add to esp</span> +<span id="L1121" class="LineNr">1121 </span> 5a/pop-to-edx +<span id="L1122" class="LineNr">1122 </span><span class="Constant">$test-get-or-stop:failure-assertion</span>: +<span id="L1123" class="LineNr">1123 </span> <span class="subxComment"># check that get-or-stop tried to call stop(1)</span> +<span id="L1124" class="LineNr">1124 </span> <span class="subxS1Comment"># . check-ints-equal(ed->value, 2, msg)</span> +<span id="L1125" class="LineNr">1125 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1126" class="LineNr">1126 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1033'>test-get-or-stop</a>/1"</span>/imm32 +<span id="L1127" class="LineNr">1127 </span> 68/push 2/imm32 +<span id="L1128" class="LineNr">1128 </span> <span class="subxS2Comment"># . . push ed->value</span> +<span id="L1129" class="LineNr">1129 </span> ff 6/subop/push 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(edx+4)</span> +<span id="L1130" class="LineNr">1130 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1131" class="LineNr">1131 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1132" class="LineNr">1132 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1133" class="LineNr">1133 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1134" class="LineNr">1134 </span><span class="Constant">$test-get-or-stop:end</span>: +<span id="L1135" class="LineNr">1135 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1136" class="LineNr">1136 </span> <span class="subxComment"># don't restore esp from ebp; manually reclaim locals</span> +<span id="L1137" class="LineNr">1137 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x24/imm32 <span class="subxComment"># add to esp</span> +<span id="L1138" class="LineNr">1138 </span> 5d/pop-to-ebp +<span id="L1139" class="LineNr">1139 </span> c3/return +<span id="L1140" class="LineNr">1140 </span> +<span id="L1141" class="LineNr">1141 </span><span class="subxComment"># if no row is found, stop(ed)</span> +<span id="L1142" class="LineNr">1142 </span><span class="subxFunction">get-slice-or-stop</span>: <span class="subxComment"># table : (address stream {string, _}), key : (address slice), row-size : int,</span> +<span id="L1143" class="LineNr">1143 </span> <span class="subxComment"># abort-message-prefix : (address string), err : (address buffered-file), ed : (address exit-descriptor)</span> +<span id="L1144" class="LineNr">1144 </span> <span class="subxComment"># -> eax : (address _)</span> +<span id="L1145" class="LineNr">1145 </span> <span class="subxComment"># pseudocode:</span> +<span id="L1146" class="LineNr">1146 </span> <span class="subxComment"># curr = table->data</span> +<span id="L1147" class="LineNr">1147 </span> <span class="subxComment"># max = &table->data[table->write]</span> +<span id="L1148" class="LineNr">1148 </span> <span class="subxComment"># while curr < max</span> +<span id="L1149" class="LineNr">1149 </span> <span class="subxComment"># if slice-equal?(key, *curr)</span> +<span id="L1150" class="LineNr">1150 </span> <span class="subxComment"># return curr+4</span> +<span id="L1151" class="LineNr">1151 </span> <span class="subxComment"># curr += row-size</span> +<span id="L1152" class="LineNr">1152 </span> <span class="subxComment"># write-buffered(err, msg)</span> +<span id="L1153" class="LineNr">1153 </span> <span class="subxComment"># stop(ed)</span> +<span id="L1154" class="LineNr">1154 </span> <span class="subxComment">#</span> +<span id="L1155" class="LineNr">1155 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1156" class="LineNr">1156 </span> 55/push-ebp +<span id="L1157" class="LineNr">1157 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> +<span id="L1158" class="LineNr">1158 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L1159" class="LineNr">1159 </span> 51/push-ecx +<span id="L1160" class="LineNr">1160 </span> 52/push-edx +<span id="L1161" class="LineNr">1161 </span> 56/push-esi +<span id="L1162" class="LineNr">1162 </span> <span class="subxComment"># esi = table</span> +<span id="L1163" class="LineNr">1163 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> +<span id="L1164" class="LineNr">1164 </span> <span class="subxComment"># curr/ecx = table->data</span> +<span id="L1165" class="LineNr">1165 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> +<span id="L1166" class="LineNr">1166 </span> <span class="subxComment"># max/edx = table->data + table->write</span> +<span id="L1167" class="LineNr">1167 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> +<span id="L1168" class="LineNr">1168 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> +<span id="L1169" class="LineNr">1169 </span><span class="Constant">$get-slice-or-stop:search-loop</span>: +<span id="L1170" class="LineNr">1170 </span> <span class="subxComment"># if (curr >= max) stop(ed)</span> +<span id="L1171" class="LineNr">1171 </span> 39/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ecx with edx</span> +<span id="L1172" class="LineNr">1172 </span> 73/jump-if-greater-or-equal-unsigned $get-slice-or-stop:<a href='059stop.subx.html#L92'>stop</a>/disp8 +<span id="L1173" class="LineNr">1173 </span> <span class="subxComment"># if (slice-equal?(key, *curr)) return curr+4</span> +<span id="L1174" class="LineNr">1174 </span> <span class="subxS1Comment"># . eax = slice-equal?(key, *curr)</span> +<span id="L1175" class="LineNr">1175 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1176" class="LineNr">1176 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> +<span id="L1177" class="LineNr">1177 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> +<span id="L1178" class="LineNr">1178 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1179" class="LineNr">1179 </span> e8/call <a href='072slice.subx.html#L91'>slice-equal?</a>/disp32 +<span id="L1180" class="LineNr">1180 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1181" class="LineNr">1181 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1182" class="LineNr">1182 </span> <span class="subxS1Comment"># . if (eax != 0) return eax = curr+4</span> +<span id="L1183" class="LineNr">1183 </span> 3d/compare-eax-and 0/imm32 +<span id="L1184" class="LineNr">1184 </span> 74/jump-if-equal $get-slice-or-stop:mismatch/disp8 +<span id="L1185" class="LineNr">1185 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+4 to eax</span> +<span id="L1186" class="LineNr">1186 </span> eb/jump $get-slice-or-stop:end/disp8 +<span id="L1187" class="LineNr">1187 </span><span class="Constant">$get-slice-or-stop:mismatch</span>: +<span id="L1188" class="LineNr">1188 </span> <span class="subxComment"># curr += row-size</span> +<span id="L1189" class="LineNr">1189 </span> 03/add 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># add *(ebp+16) to ecx</span> +<span id="L1190" class="LineNr">1190 </span> <span class="subxComment"># loop</span> +<span id="L1191" class="LineNr">1191 </span> eb/jump $get-slice-or-stop:search-loop/disp8 +<span id="L1192" class="LineNr">1192 </span><span class="Constant">$get-slice-or-stop:end</span>: +<span id="L1193" class="LineNr">1193 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L1194" class="LineNr">1194 </span> 5e/pop-to-esi +<span id="L1195" class="LineNr">1195 </span> 5a/pop-to-edx +<span id="L1196" class="LineNr">1196 </span> 59/pop-to-ecx +<span id="L1197" class="LineNr">1197 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1198" class="LineNr">1198 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> +<span id="L1199" class="LineNr">1199 </span> 5d/pop-to-ebp +<span id="L1200" class="LineNr">1200 </span> c3/return +<span id="L1201" class="LineNr">1201 </span> +<span id="L1202" class="LineNr">1202 </span><span class="Constant">$get-slice-or-stop:<a href='059stop.subx.html#L92'>stop</a></span>: +<span id="L1203" class="LineNr">1203 </span> <span class="subxS1Comment"># . write-buffered(err, abort-message-prefix)</span> +<span id="L1204" class="LineNr">1204 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1205" class="LineNr">1205 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x14/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+20)</span> +<span id="L1206" class="LineNr">1206 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> +<span id="L1207" class="LineNr">1207 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1208" class="LineNr">1208 </span> e8/call <a href='065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L1209" class="LineNr">1209 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1210" class="LineNr">1210 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1211" class="LineNr">1211 </span> <span class="subxS1Comment"># . write-buffered(err, error)</span> +<span id="L1212" class="LineNr">1212 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1213" class="LineNr">1213 </span> 68/push <span class="Constant">": <a href='081table.subx.html#L1142'>get-slice-or-stop</a>: key not found: "</span>/imm32 +<span id="L1214" class="LineNr">1214 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> +<span id="L1215" class="LineNr">1215 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1216" class="LineNr">1216 </span> e8/call <a href='065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L1217" class="LineNr">1217 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1218" class="LineNr">1218 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1219" class="LineNr">1219 </span> <span class="subxS1Comment"># . write-slice-buffered(err, key)</span> +<span id="L1220" class="LineNr">1220 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1221" class="LineNr">1221 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> +<span id="L1222" class="LineNr">1222 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> +<span id="L1223" class="LineNr">1223 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1224" class="LineNr">1224 </span> e8/call <a href='072slice.subx.html#L878'>write-slice-buffered</a>/disp32 +<span id="L1225" class="LineNr">1225 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1226" class="LineNr">1226 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1227" class="LineNr">1227 </span> <span class="subxS1Comment"># . write-buffered(err, "\n")</span> +<span id="L1228" class="LineNr">1228 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1229" class="LineNr">1229 </span> 68/push <span class="SpecialChar"><a href='051test.subx.html#L83'>Newline</a></span>/imm32 +<span id="L1230" class="LineNr">1230 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+24)</span> +<span id="L1231" class="LineNr">1231 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1232" class="LineNr">1232 </span> e8/call <a href='065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L1233" class="LineNr">1233 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1234" class="LineNr">1234 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1235" class="LineNr">1235 </span> <span class="subxS1Comment"># . stop(ed, 1)</span> +<span id="L1236" class="LineNr">1236 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1237" class="LineNr">1237 </span> 68/push 1/imm32 +<span id="L1238" class="LineNr">1238 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x1c/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+28)</span> +<span id="L1239" class="LineNr">1239 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1240" class="LineNr">1240 </span> e8/call <a href='059stop.subx.html#L92'>stop</a>/disp32 +<span id="L1241" class="LineNr">1241 </span> <span class="subxComment"># never gets here</span> +<span id="L1242" class="LineNr">1242 </span><span class="Constant">$get-slice-or-stop:terminus</span>: +<span id="L1243" class="LineNr">1243 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1244" class="LineNr">1244 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1245" class="LineNr">1245 </span> <span class="subxComment"># syscall(exit, 1)</span> +<span id="L1246" class="LineNr">1246 </span> b8/copy-to-eax 1/imm32/exit +<span id="L1247" class="LineNr">1247 </span> cd/syscall 0x80/imm8 +<span id="L1248" class="LineNr">1248 </span> +<span id="L1249" class="LineNr">1249 </span><span class="subxTest">test-get-slice-or-stop</span>: +<span id="L1250" class="LineNr">1250 </span> <span class="subxComment"># This test uses exit-descriptors. Use ebp for setting up local variables.</span> +<span id="L1251" class="LineNr">1251 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1252" class="LineNr">1252 </span> 55/push-ebp +<span id="L1253" class="LineNr">1253 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> +<span id="L1254" class="LineNr">1254 </span> <span class="subxComment"># setup</span> +<span id="L1255" class="LineNr">1255 </span> <span class="subxS1Comment"># . clear-stream(_test-error-stream)</span> +<span id="L1256" class="LineNr">1256 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1257" class="LineNr">1257 </span> 68/push <a href='064write-byte.subx.html#L341'>_test-error-stream</a>/imm32 +<span id="L1258" class="LineNr">1258 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1259" class="LineNr">1259 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L1260" class="LineNr">1260 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1261" class="LineNr">1261 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> +<span id="L1262" class="LineNr">1262 </span> <span class="subxS1Comment"># . clear-stream(_test-error-buffered-file->buffer)</span> +<span id="L1263" class="LineNr">1263 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1264" class="LineNr">1264 </span> 68/push <a href='064write-byte.subx.html#L362'>_test-error-buffered-file->buffer</a>/imm32 +<span id="L1265" class="LineNr">1265 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1266" class="LineNr">1266 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L1267" class="LineNr">1267 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1268" class="LineNr">1268 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span> +<span id="L1269" class="LineNr">1269 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> +<span id="L1270" class="LineNr">1270 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> +<span id="L1271" class="LineNr">1271 </span> 68/push 0x10/imm32/length +<span id="L1272" class="LineNr">1272 </span> 68/push 0/imm32/read +<span id="L1273" class="LineNr">1273 </span> 68/push 0/imm32/write +<span id="L1274" class="LineNr">1274 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> +<span id="L1275" class="LineNr">1275 </span> <span class="subxComment"># var ed/edx : (address exit-descriptor)</span> +<span id="L1276" class="LineNr">1276 </span> 68/push 0/imm32 +<span id="L1277" class="LineNr">1277 </span> 68/push 0/imm32 +<span id="L1278" class="LineNr">1278 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> +<span id="L1279" class="LineNr">1279 </span> <span class="subxComment"># var slice/ebx = "code"</span> +<span id="L1280" class="LineNr">1280 </span> <span class="subxS1Comment"># . (eax..ebx) = "code"</span> +<span id="L1281" class="LineNr">1281 </span> b8/copy-to-eax <span class="Constant">"code"</span>/imm32 +<span id="L1282" class="LineNr">1282 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to ebx</span> +<span id="L1283" class="LineNr">1283 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 3/index/ebx <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ebx+4 to ebx</span> +<span id="L1284" class="LineNr">1284 </span> 05/add-to-eax 4/imm32 +<span id="L1285" class="LineNr">1285 </span> <span class="subxS1Comment"># . ebx = {eax, ebx}</span> +<span id="L1286" class="LineNr">1286 </span> 53/push-ebx +<span id="L1287" class="LineNr">1287 </span> 50/push-eax +<span id="L1288" class="LineNr">1288 </span> 89/copy 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebx</span> +<span id="L1289" class="LineNr">1289 </span> <span class="subxComment"># size 'ed' for the calls to 'get-or-stop' (define no locals past this point)</span> +<span id="L1290" class="LineNr">1290 </span> <span class="subxS1Comment"># . tailor-exit-descriptor(ed, 24)</span> +<span id="L1291" class="LineNr">1291 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1292" class="LineNr">1292 </span> 68/push 0x18/imm32/nbytes-of-args-for-get-or-stop +<span id="L1293" class="LineNr">1293 </span> 52/push-edx +<span id="L1294" class="LineNr">1294 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1295" class="LineNr">1295 </span> e8/call <a href='059stop.subx.html#L44'>tailor-exit-descriptor</a>/disp32 +<span id="L1296" class="LineNr">1296 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1297" class="LineNr">1297 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1298" class="LineNr">1298 </span> <span class="subxComment"># insert(table, "code", 8 bytes per row)</span> +<span id="L1299" class="LineNr">1299 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1300" class="LineNr">1300 </span> 68/push 8/imm32/row-size +<span id="L1301" class="LineNr">1301 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1302" class="LineNr">1302 </span> 51/push-ecx +<span id="L1303" class="LineNr">1303 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1304" class="LineNr">1304 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 +<span id="L1305" class="LineNr">1305 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1306" class="LineNr">1306 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1307" class="LineNr">1307 </span><span class="Constant">$test-get-slice-or-stop:success</span>: +<span id="L1308" class="LineNr">1308 </span> <span class="subxComment"># eax = get-slice-or-stop(table, slice, row-size=8, msg, _test-error-buffered-file, ed)</span> +<span id="L1309" class="LineNr">1309 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1310" class="LineNr">1310 </span> 52/push-edx/ed +<span id="L1311" class="LineNr">1311 </span> 68/push <a href='064write-byte.subx.html#L359'>_test-error-buffered-file</a>/imm32 +<span id="L1312" class="LineNr">1312 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix +<span id="L1313" class="LineNr">1313 </span> 68/push 8/imm32/row-size +<span id="L1314" class="LineNr">1314 </span> 53/push-ebx/slice +<span id="L1315" class="LineNr">1315 </span> 51/push-ecx +<span id="L1316" class="LineNr">1316 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1317" class="LineNr">1317 </span> e8/call <a href='081table.subx.html#L1142'>get-slice-or-stop</a>/disp32 +<span id="L1318" class="LineNr">1318 </span> <span class="subxComment"># registers except esp may be clobbered at this point</span> +<span id="L1319" class="LineNr">1319 </span> <span class="subxComment"># restore register args, discard others</span> +<span id="L1320" class="LineNr">1320 </span> 59/pop-to-ecx +<span id="L1321" class="LineNr">1321 </span> 5b/pop-to-ebx +<span id="L1322" class="LineNr">1322 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1323" class="LineNr">1323 </span> 5a/pop-to-edx +<span id="L1324" class="LineNr">1324 </span><span class="Constant">$test-get-slice-or-stop:success-assertion</span>: +<span id="L1325" class="LineNr">1325 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg) # first row's value slot returned</span> +<span id="L1326" class="LineNr">1326 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> +<span id="L1327" class="LineNr">1327 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1328" class="LineNr">1328 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1249'>test-get-slice-or-stop</a>/0"</span>/imm32 +<span id="L1329" class="LineNr">1329 </span> 68/push 0x10/imm32 +<span id="L1330" class="LineNr">1330 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> +<span id="L1331" class="LineNr">1331 </span> 50/push-eax +<span id="L1332" class="LineNr">1332 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1333" class="LineNr">1333 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1334" class="LineNr">1334 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1335" class="LineNr">1335 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1336" class="LineNr">1336 </span><span class="Constant">$test-get-slice-or-stop:failure</span>: +<span id="L1337" class="LineNr">1337 </span> <span class="subxComment"># slice = "segment2"</span> +<span id="L1338" class="LineNr">1338 </span> <span class="subxS1Comment"># . *ebx = "segment2"->data</span> +<span id="L1339" class="LineNr">1339 </span> b8/copy-to-eax <span class="Constant">"segment2"</span>/imm32 +<span id="L1340" class="LineNr">1340 </span> 05/add-to-eax 4/imm32 +<span id="L1341" class="LineNr">1341 </span> 89/copy 0/mod/indirect 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to *ebx</span> +<span id="L1342" class="LineNr">1342 </span> <span class="subxS1Comment"># . *(ebx+4) = "segment2"->data + len("segment2")</span> +<span id="L1343" class="LineNr">1343 </span> 05/add-to-eax 8/imm32/strlen +<span id="L1344" class="LineNr">1344 </span> 89/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(ebx+4)</span> +<span id="L1345" class="LineNr">1345 </span> <span class="subxComment"># eax = get-slice-or-stop(table, slice, row-size=8, msg, _test-error-buffered-file, ed)</span> +<span id="L1346" class="LineNr">1346 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1347" class="LineNr">1347 </span> 52/push-edx/ed +<span id="L1348" class="LineNr">1348 </span> 68/push <a href='064write-byte.subx.html#L359'>_test-error-buffered-file</a>/imm32 +<span id="L1349" class="LineNr">1349 </span> 68/push <span class="Constant">"foo"</span>/imm32/abort-prefix +<span id="L1350" class="LineNr">1350 </span> 68/push 8/imm32/row-size +<span id="L1351" class="LineNr">1351 </span> 53/push-ebx/slice +<span id="L1352" class="LineNr">1352 </span> 51/push-ecx +<span id="L1353" class="LineNr">1353 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1354" class="LineNr">1354 </span> e8/call <a href='081table.subx.html#L1142'>get-slice-or-stop</a>/disp32 +<span id="L1355" class="LineNr">1355 </span> <span class="subxComment"># registers except esp may be clobbered at this point</span> +<span id="L1356" class="LineNr">1356 </span> <span class="subxComment"># restore register args, discard others</span> +<span id="L1357" class="LineNr">1357 </span> 59/pop-to-ecx +<span id="L1358" class="LineNr">1358 </span> 5b/pop-to-ebx +<span id="L1359" class="LineNr">1359 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1360" class="LineNr">1360 </span> 5a/pop-to-edx +<span id="L1361" class="LineNr">1361 </span><span class="Constant">$test-get-slice-or-stop:failure-assertion</span>: +<span id="L1362" class="LineNr">1362 </span> <span class="subxComment"># check that get-or-stop tried to call stop(1)</span> +<span id="L1363" class="LineNr">1363 </span> <span class="subxS1Comment"># . check-ints-equal(ed->value, 2, msg)</span> +<span id="L1364" class="LineNr">1364 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1365" class="LineNr">1365 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1033'>test-get-or-stop</a>/1"</span>/imm32 +<span id="L1366" class="LineNr">1366 </span> 68/push 2/imm32 +<span id="L1367" class="LineNr">1367 </span> <span class="subxS2Comment"># . . push ed->value</span> +<span id="L1368" class="LineNr">1368 </span> ff 6/subop/push 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(edx+4)</span> +<span id="L1369" class="LineNr">1369 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1370" class="LineNr">1370 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1371" class="LineNr">1371 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1372" class="LineNr">1372 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1373" class="LineNr">1373 </span><span class="Constant">$test-get-slice-or-stop:end</span>: +<span id="L1374" class="LineNr">1374 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1375" class="LineNr">1375 </span> <span class="subxComment"># don't restore esp from ebp; manually reclaim locals</span> +<span id="L1376" class="LineNr">1376 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x2c/imm32 <span class="subxComment"># add to esp</span> +<span id="L1377" class="LineNr">1377 </span> 5d/pop-to-ebp +<span id="L1378" class="LineNr">1378 </span> c3/return +<span id="L1379" class="LineNr">1379 </span> +<span id="L1380" class="LineNr">1380 </span><span class="subxComment"># if no row is found, return null (0)</span> +<span id="L1381" class="LineNr">1381 </span><span class="subxFunction">maybe-get</span>: <span class="subxComment"># table : (address stream {string, _}), key : (address string), row-size : int -> eax : (address _)</span> +<span id="L1382" class="LineNr">1382 </span> <span class="subxComment"># pseudocode:</span> +<span id="L1383" class="LineNr">1383 </span> <span class="subxComment"># curr = table->data</span> +<span id="L1384" class="LineNr">1384 </span> <span class="subxComment"># max = &table->data[table->write]</span> +<span id="L1385" class="LineNr">1385 </span> <span class="subxComment"># while curr < max</span> +<span id="L1386" class="LineNr">1386 </span> <span class="subxComment"># if string-equal?(key, *curr)</span> +<span id="L1387" class="LineNr">1387 </span> <span class="subxComment"># return curr+4</span> +<span id="L1388" class="LineNr">1388 </span> <span class="subxComment"># curr += row-size</span> +<span id="L1389" class="LineNr">1389 </span> <span class="subxComment"># return 0</span> +<span id="L1390" class="LineNr">1390 </span> <span class="subxComment">#</span> +<span id="L1391" class="LineNr">1391 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1392" class="LineNr">1392 </span> 55/push-ebp +<span id="L1393" class="LineNr">1393 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> +<span id="L1394" class="LineNr">1394 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L1395" class="LineNr">1395 </span> 51/push-ecx +<span id="L1396" class="LineNr">1396 </span> 52/push-edx +<span id="L1397" class="LineNr">1397 </span> 56/push-esi +<span id="L1398" class="LineNr">1398 </span> <span class="subxComment"># esi = table</span> +<span id="L1399" class="LineNr">1399 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> +<span id="L1400" class="LineNr">1400 </span> <span class="subxComment"># curr/ecx = table->data</span> +<span id="L1401" class="LineNr">1401 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> +<span id="L1402" class="LineNr">1402 </span> <span class="subxComment"># max/edx = table->data + table->write</span> +<span id="L1403" class="LineNr">1403 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> +<span id="L1404" class="LineNr">1404 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> +<span id="L1405" class="LineNr">1405 </span><span class="Constant">$maybe-get:search-loop</span>: +<span id="L1406" class="LineNr">1406 </span> <span class="subxComment"># if (curr >= max) return null</span> +<span id="L1407" class="LineNr">1407 </span> 39/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ecx with edx</span> +<span id="L1408" class="LineNr">1408 </span> 73/jump-if-greater-or-equal-unsigned $maybe-get:null/disp8 +<span id="L1409" class="LineNr">1409 </span> <span class="subxComment"># if (string-equal?(key, *curr)) return curr+4</span> +<span id="L1410" class="LineNr">1410 </span> <span class="subxS1Comment"># . eax = string-equal?(key, *curr)</span> +<span id="L1411" class="LineNr">1411 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1412" class="LineNr">1412 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> +<span id="L1413" class="LineNr">1413 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> +<span id="L1414" class="LineNr">1414 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1415" class="LineNr">1415 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal?</a>/disp32 +<span id="L1416" class="LineNr">1416 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1417" class="LineNr">1417 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1418" class="LineNr">1418 </span> <span class="subxS1Comment"># . if (eax != 0) return eax = curr+4</span> +<span id="L1419" class="LineNr">1419 </span> 3d/compare-eax-and 0/imm32 +<span id="L1420" class="LineNr">1420 </span> 74/jump-if-equal $maybe-get:mismatch/disp8 +<span id="L1421" class="LineNr">1421 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+4 to eax</span> +<span id="L1422" class="LineNr">1422 </span> eb/jump $maybe-get:end/disp8 +<span id="L1423" class="LineNr">1423 </span><span class="Constant">$maybe-get:mismatch</span>: +<span id="L1424" class="LineNr">1424 </span> <span class="subxComment"># curr += row-size</span> +<span id="L1425" class="LineNr">1425 </span> 03/add 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># add *(ebp+16) to ecx</span> +<span id="L1426" class="LineNr">1426 </span> <span class="subxComment"># loop</span> +<span id="L1427" class="LineNr">1427 </span> eb/jump $maybe-get:search-loop/disp8 +<span id="L1428" class="LineNr">1428 </span><span class="Constant">$maybe-get:null</span>: +<span id="L1429" class="LineNr">1429 </span> b8/copy-to-eax 0/imm32 +<span id="L1430" class="LineNr">1430 </span><span class="Constant">$maybe-get:end</span>: +<span id="L1431" class="LineNr">1431 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L1432" class="LineNr">1432 </span> 5e/pop-to-esi +<span id="L1433" class="LineNr">1433 </span> 5a/pop-to-edx +<span id="L1434" class="LineNr">1434 </span> 59/pop-to-ecx +<span id="L1435" class="LineNr">1435 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1436" class="LineNr">1436 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> +<span id="L1437" class="LineNr">1437 </span> 5d/pop-to-ebp +<span id="L1438" class="LineNr">1438 </span> c3/return +<span id="L1439" class="LineNr">1439 </span> +<span id="L1440" class="LineNr">1440 </span><span class="subxTest">test-maybe-get</span>: +<span id="L1441" class="LineNr">1441 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1442" class="LineNr">1442 </span> 55/push-ebp +<span id="L1443" class="LineNr">1443 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> +<span id="L1444" class="LineNr">1444 </span> <span class="subxH1Comment"># - setup: create a table with one row</span> +<span id="L1445" class="LineNr">1445 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> +<span id="L1446" class="LineNr">1446 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> +<span id="L1447" class="LineNr">1447 </span> 68/push 0x10/imm32/length +<span id="L1448" class="LineNr">1448 </span> 68/push 0/imm32/read +<span id="L1449" class="LineNr">1449 </span> 68/push 0/imm32/write +<span id="L1450" class="LineNr">1450 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> +<span id="L1451" class="LineNr">1451 </span> <span class="subxComment"># eax = get-or-insert(table, "code", 8 bytes per row)</span> +<span id="L1452" class="LineNr">1452 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1453" class="LineNr">1453 </span> 68/push 8/imm32/row-size +<span id="L1454" class="LineNr">1454 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1455" class="LineNr">1455 </span> 51/push-ecx +<span id="L1456" class="LineNr">1456 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1457" class="LineNr">1457 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 +<span id="L1458" class="LineNr">1458 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1459" class="LineNr">1459 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1460" class="LineNr">1460 </span><span class="Constant">$test-maybe-get:success</span>: +<span id="L1461" class="LineNr">1461 </span> <span class="subxH1Comment"># - check for the same key, verify that it was reused</span> +<span id="L1462" class="LineNr">1462 </span> <span class="subxComment"># eax = maybe-get(table, "code", 8 bytes per row)</span> +<span id="L1463" class="LineNr">1463 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1464" class="LineNr">1464 </span> 68/push 8/imm32/row-size +<span id="L1465" class="LineNr">1465 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1466" class="LineNr">1466 </span> 51/push-ecx +<span id="L1467" class="LineNr">1467 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1468" class="LineNr">1468 </span> e8/call <a href='081table.subx.html#L1381'>maybe-get</a>/disp32 +<span id="L1469" class="LineNr">1469 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1470" class="LineNr">1470 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1471" class="LineNr">1471 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg)</span> +<span id="L1472" class="LineNr">1472 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> +<span id="L1473" class="LineNr">1473 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1474" class="LineNr">1474 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1440'>test-maybe-get</a>/0"</span>/imm32 +<span id="L1475" class="LineNr">1475 </span> 68/push 0x10/imm32 +<span id="L1476" class="LineNr">1476 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> +<span id="L1477" class="LineNr">1477 </span> 50/push-eax +<span id="L1478" class="LineNr">1478 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1479" class="LineNr">1479 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1480" class="LineNr">1480 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1481" class="LineNr">1481 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1482" class="LineNr">1482 </span> <span class="subxComment"># no new row inserted</span> +<span id="L1483" class="LineNr">1483 </span> <span class="subxS1Comment"># . check-ints-equal(table->write, row-size = 8, msg)</span> +<span id="L1484" class="LineNr">1484 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1485" class="LineNr">1485 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1440'>test-maybe-get</a>/1"</span>/imm32 +<span id="L1486" class="LineNr">1486 </span> 68/push 8/imm32/row-size +<span id="L1487" class="LineNr">1487 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> +<span id="L1488" class="LineNr">1488 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1489" class="LineNr">1489 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1490" class="LineNr">1490 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1491" class="LineNr">1491 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1492" class="LineNr">1492 </span> <span class="subxComment"># check-string-equal(*table->data, "code", msg)</span> +<span id="L1493" class="LineNr">1493 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1494" class="LineNr">1494 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1440'>test-maybe-get</a>/2"</span>/imm32 +<span id="L1495" class="LineNr">1495 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1496" class="LineNr">1496 </span> ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ecx+12)</span> +<span id="L1497" class="LineNr">1497 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1498" class="LineNr">1498 </span> e8/call <a href='054string-equal.subx.html#L178'>check-string-equal</a>/disp32 +<span id="L1499" class="LineNr">1499 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1500" class="LineNr">1500 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1501" class="LineNr">1501 </span><span class="Constant">$test-maybe-get:failure</span>: +<span id="L1502" class="LineNr">1502 </span> <span class="subxH1Comment"># - search for a new key</span> +<span id="L1503" class="LineNr">1503 </span> <span class="subxComment"># eax = maybe-get(table, "data", 8 bytes per row)</span> +<span id="L1504" class="LineNr">1504 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1505" class="LineNr">1505 </span> 68/push 8/imm32/row-size +<span id="L1506" class="LineNr">1506 </span> 68/push <span class="Constant">"data"</span>/imm32 +<span id="L1507" class="LineNr">1507 </span> 51/push-ecx +<span id="L1508" class="LineNr">1508 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1509" class="LineNr">1509 </span> e8/call <a href='081table.subx.html#L1381'>maybe-get</a>/disp32 +<span id="L1510" class="LineNr">1510 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1511" class="LineNr">1511 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1512" class="LineNr">1512 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span> +<span id="L1513" class="LineNr">1513 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1514" class="LineNr">1514 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1440'>test-maybe-get</a>/3"</span>/imm32 +<span id="L1515" class="LineNr">1515 </span> 68/push 0/imm32 +<span id="L1516" class="LineNr">1516 </span> 50/push-eax +<span id="L1517" class="LineNr">1517 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1518" class="LineNr">1518 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1519" class="LineNr">1519 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1520" class="LineNr">1520 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1521" class="LineNr">1521 </span><span class="Constant">$test-maybe-get:end</span>: +<span id="L1522" class="LineNr">1522 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1523" class="LineNr">1523 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> +<span id="L1524" class="LineNr">1524 </span> 5d/pop-to-ebp +<span id="L1525" class="LineNr">1525 </span> c3/return +<span id="L1526" class="LineNr">1526 </span> +<span id="L1527" class="LineNr">1527 </span><span class="subxComment"># if no row is found, return null (0)</span> +<span id="L1528" class="LineNr">1528 </span><span class="subxFunction">maybe-get-slice</span>: <span class="subxComment"># table : (address stream {string, _}), key : (address slice), row-size : int -> eax : (address _)</span> +<span id="L1529" class="LineNr">1529 </span> <span class="subxComment"># pseudocode:</span> +<span id="L1530" class="LineNr">1530 </span> <span class="subxComment"># curr = table->data</span> +<span id="L1531" class="LineNr">1531 </span> <span class="subxComment"># max = &table->data[table->write]</span> +<span id="L1532" class="LineNr">1532 </span> <span class="subxComment"># while curr < max</span> +<span id="L1533" class="LineNr">1533 </span> <span class="subxComment"># if slice-equal?(key, *curr)</span> +<span id="L1534" class="LineNr">1534 </span> <span class="subxComment"># return curr+4</span> +<span id="L1535" class="LineNr">1535 </span> <span class="subxComment"># curr += row-size</span> +<span id="L1536" class="LineNr">1536 </span> <span class="subxComment"># return 0</span> +<span id="L1537" class="LineNr">1537 </span> <span class="subxComment">#</span> +<span id="L1538" class="LineNr">1538 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1539" class="LineNr">1539 </span> 55/push-ebp +<span id="L1540" class="LineNr">1540 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> +<span id="L1541" class="LineNr">1541 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L1542" class="LineNr">1542 </span> 51/push-ecx +<span id="L1543" class="LineNr">1543 </span> 52/push-edx +<span id="L1544" class="LineNr">1544 </span> 56/push-esi +<span id="L1545" class="LineNr">1545 </span> <span class="subxComment"># esi = table</span> +<span id="L1546" class="LineNr">1546 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> +<span id="L1547" class="LineNr">1547 </span> <span class="subxComment"># curr/ecx = table->data</span> +<span id="L1548" class="LineNr">1548 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> +<span id="L1549" class="LineNr">1549 </span> <span class="subxComment"># max/edx = table->data + table->write</span> +<span id="L1550" class="LineNr">1550 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> +<span id="L1551" class="LineNr">1551 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> +<span id="L1552" class="LineNr">1552 </span><span class="Constant">$maybe-get-slice:search-loop</span>: +<span id="L1553" class="LineNr">1553 </span> <span class="subxComment"># if (curr >= max) return null</span> +<span id="L1554" class="LineNr">1554 </span> 39/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ecx with edx</span> +<span id="L1555" class="LineNr">1555 </span> 73/jump-if-greater-or-equal-unsigned $maybe-get-slice:null/disp8 +<span id="L1556" class="LineNr">1556 </span> <span class="subxComment"># if (slice-equal?(key, *curr)) return curr+4</span> +<span id="L1557" class="LineNr">1557 </span> <span class="subxS1Comment"># . eax = slice-equal?(key, *curr)</span> +<span id="L1558" class="LineNr">1558 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1559" class="LineNr">1559 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> +<span id="L1560" class="LineNr">1560 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span> +<span id="L1561" class="LineNr">1561 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1562" class="LineNr">1562 </span> e8/call <a href='072slice.subx.html#L91'>slice-equal?</a>/disp32 +<span id="L1563" class="LineNr">1563 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1564" class="LineNr">1564 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1565" class="LineNr">1565 </span> <span class="subxS1Comment"># . if (eax != 0) return eax = curr+4</span> +<span id="L1566" class="LineNr">1566 </span> 3d/compare-eax-and 0/imm32 +<span id="L1567" class="LineNr">1567 </span> 74/jump-if-equal $maybe-get-slice:mismatch/disp8 +<span id="L1568" class="LineNr">1568 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+4 to eax</span> +<span id="L1569" class="LineNr">1569 </span> eb/jump $maybe-get-slice:end/disp8 +<span id="L1570" class="LineNr">1570 </span><span class="Constant">$maybe-get-slice:mismatch</span>: +<span id="L1571" class="LineNr">1571 </span> <span class="subxComment"># curr += row-size</span> +<span id="L1572" class="LineNr">1572 </span> 03/add 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># add *(ebp+16) to ecx</span> +<span id="L1573" class="LineNr">1573 </span> <span class="subxComment"># loop</span> +<span id="L1574" class="LineNr">1574 </span> eb/jump $maybe-get-slice:search-loop/disp8 +<span id="L1575" class="LineNr">1575 </span><span class="Constant">$maybe-get-slice:null</span>: +<span id="L1576" class="LineNr">1576 </span> b8/copy-to-eax 0/imm32 +<span id="L1577" class="LineNr">1577 </span><span class="Constant">$maybe-get-slice:end</span>: +<span id="L1578" class="LineNr">1578 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L1579" class="LineNr">1579 </span> 5e/pop-to-esi +<span id="L1580" class="LineNr">1580 </span> 5a/pop-to-edx +<span id="L1581" class="LineNr">1581 </span> 59/pop-to-ecx +<span id="L1582" class="LineNr">1582 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1583" class="LineNr">1583 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> +<span id="L1584" class="LineNr">1584 </span> 5d/pop-to-ebp +<span id="L1585" class="LineNr">1585 </span> c3/return +<span id="L1586" class="LineNr">1586 </span> +<span id="L1587" class="LineNr">1587 </span><span class="subxTest">test-maybe-get-slice</span>: +<span id="L1588" class="LineNr">1588 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1589" class="LineNr">1589 </span> 55/push-ebp +<span id="L1590" class="LineNr">1590 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> +<span id="L1591" class="LineNr">1591 </span> <span class="subxH1Comment"># - setup: create a table with one row</span> +<span id="L1592" class="LineNr">1592 </span> <span class="subxComment"># var table/ecx : (address stream {string, number}) = stream(2 rows * 8 bytes)</span> +<span id="L1593" class="LineNr">1593 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># subtract from esp</span> +<span id="L1594" class="LineNr">1594 </span> 68/push 0x10/imm32/length +<span id="L1595" class="LineNr">1595 </span> 68/push 0/imm32/read +<span id="L1596" class="LineNr">1596 </span> 68/push 0/imm32/write +<span id="L1597" class="LineNr">1597 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> +<span id="L1598" class="LineNr">1598 </span> <span class="subxComment"># insert(table, "code", 8 bytes per row)</span> +<span id="L1599" class="LineNr">1599 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1600" class="LineNr">1600 </span> 68/push 8/imm32/row-size +<span id="L1601" class="LineNr">1601 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1602" class="LineNr">1602 </span> 51/push-ecx +<span id="L1603" class="LineNr">1603 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1604" class="LineNr">1604 </span> e8/call <a href='081table.subx.html#L403'>get-or-insert</a>/disp32 +<span id="L1605" class="LineNr">1605 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1606" class="LineNr">1606 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1607" class="LineNr">1607 </span><span class="Constant">$test-maybe-get-slice:success</span>: +<span id="L1608" class="LineNr">1608 </span> <span class="subxH1Comment"># - check for the same key, verify that it was reused</span> +<span id="L1609" class="LineNr">1609 </span> <span class="subxComment"># (eax..edx) = "code"</span> +<span id="L1610" class="LineNr">1610 </span> b8/copy-to-eax <span class="Constant">"code"</span>/imm32 +<span id="L1611" class="LineNr">1611 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to edx</span> +<span id="L1612" class="LineNr">1612 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 2/index/edx <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+edx+4 to edx</span> +<span id="L1613" class="LineNr">1613 </span> 05/add-to-eax 4/imm32 +<span id="L1614" class="LineNr">1614 </span> <span class="subxComment"># var slice/edx = {eax, edx}</span> +<span id="L1615" class="LineNr">1615 </span> 52/push-edx +<span id="L1616" class="LineNr">1616 </span> 50/push-eax +<span id="L1617" class="LineNr">1617 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> +<span id="L1618" class="LineNr">1618 </span> <span class="subxComment"># eax = maybe-get-slice(table, "code" slice, 8 bytes per row)</span> +<span id="L1619" class="LineNr">1619 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1620" class="LineNr">1620 </span> 68/push 8/imm32/row-size +<span id="L1621" class="LineNr">1621 </span> 52/push-edx +<span id="L1622" class="LineNr">1622 </span> 51/push-ecx +<span id="L1623" class="LineNr">1623 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1624" class="LineNr">1624 </span> e8/call <a href='081table.subx.html#L1528'>maybe-get-slice</a>/disp32 +<span id="L1625" class="LineNr">1625 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1626" class="LineNr">1626 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1627" class="LineNr">1627 </span> <span class="subxComment"># check-ints-equal(eax - table->data, 4, msg)</span> +<span id="L1628" class="LineNr">1628 </span> <span class="subxS1Comment"># . check-ints-equal(eax - table, 16, msg)</span> +<span id="L1629" class="LineNr">1629 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1630" class="LineNr">1630 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1587'>test-maybe-get-slice</a>/0"</span>/imm32 +<span id="L1631" class="LineNr">1631 </span> 68/push 0x10/imm32 +<span id="L1632" class="LineNr">1632 </span> 29/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ecx from eax</span> +<span id="L1633" class="LineNr">1633 </span> 50/push-eax +<span id="L1634" class="LineNr">1634 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1635" class="LineNr">1635 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1636" class="LineNr">1636 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1637" class="LineNr">1637 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1638" class="LineNr">1638 </span> <span class="subxComment"># no new row inserted</span> +<span id="L1639" class="LineNr">1639 </span> <span class="subxS1Comment"># . check-ints-equal(table->write, row-size = 8, msg)</span> +<span id="L1640" class="LineNr">1640 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1641" class="LineNr">1641 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1587'>test-maybe-get-slice</a>/1"</span>/imm32 +<span id="L1642" class="LineNr">1642 </span> 68/push 8/imm32/row-size +<span id="L1643" class="LineNr">1643 </span> ff 6/subop/push 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ecx</span> +<span id="L1644" class="LineNr">1644 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1645" class="LineNr">1645 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1646" class="LineNr">1646 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1647" class="LineNr">1647 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1648" class="LineNr">1648 </span> <span class="subxComment"># check-string-equal(*table->data, "code", msg)</span> +<span id="L1649" class="LineNr">1649 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1650" class="LineNr">1650 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1587'>test-maybe-get-slice</a>/2"</span>/imm32 +<span id="L1651" class="LineNr">1651 </span> 68/push <span class="Constant">"code"</span>/imm32 +<span id="L1652" class="LineNr">1652 </span> ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ecx+12)</span> +<span id="L1653" class="LineNr">1653 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1654" class="LineNr">1654 </span> e8/call <a href='054string-equal.subx.html#L178'>check-string-equal</a>/disp32 +<span id="L1655" class="LineNr">1655 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1656" class="LineNr">1656 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1657" class="LineNr">1657 </span><span class="Constant">$test-maybe-get-slice:failure</span>: +<span id="L1658" class="LineNr">1658 </span> <span class="subxH1Comment"># - search for a new key</span> +<span id="L1659" class="LineNr">1659 </span> <span class="subxComment"># (eax..edx) = "data"</span> +<span id="L1660" class="LineNr">1660 </span> b8/copy-to-eax <span class="Constant">"data"</span>/imm32 +<span id="L1661" class="LineNr">1661 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to edx</span> +<span id="L1662" class="LineNr">1662 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 2/index/edx <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+edx+4 to edx</span> +<span id="L1663" class="LineNr">1663 </span> 05/add-to-eax 4/imm32 +<span id="L1664" class="LineNr">1664 </span> <span class="subxComment"># var slice/edx = {eax, edx}</span> +<span id="L1665" class="LineNr">1665 </span> 52/push-edx +<span id="L1666" class="LineNr">1666 </span> 50/push-eax +<span id="L1667" class="LineNr">1667 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> +<span id="L1668" class="LineNr">1668 </span> <span class="subxComment"># eax = maybe-get-slice(table, "data" slice, 8 bytes per row)</span> +<span id="L1669" class="LineNr">1669 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1670" class="LineNr">1670 </span> 68/push 8/imm32/row-size +<span id="L1671" class="LineNr">1671 </span> 52/push-edx +<span id="L1672" class="LineNr">1672 </span> 51/push-ecx +<span id="L1673" class="LineNr">1673 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1674" class="LineNr">1674 </span> e8/call <a href='081table.subx.html#L1528'>maybe-get-slice</a>/disp32 +<span id="L1675" class="LineNr">1675 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1676" class="LineNr">1676 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1677" class="LineNr">1677 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span> +<span id="L1678" class="LineNr">1678 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1679" class="LineNr">1679 </span> 68/push <span class="Constant">"F - <a href='081table.subx.html#L1587'>test-maybe-get-slice</a>/3"</span>/imm32 +<span id="L1680" class="LineNr">1680 </span> 68/push 0/imm32 +<span id="L1681" class="LineNr">1681 </span> 50/push-eax +<span id="L1682" class="LineNr">1682 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1683" class="LineNr">1683 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1684" class="LineNr">1684 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1685" class="LineNr">1685 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span> +<span id="L1686" class="LineNr">1686 </span><span class="Constant">$test-maybe-get-slice:end</span>: +<span id="L1687" class="LineNr">1687 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1688" class="LineNr">1688 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span> +<span id="L1689" class="LineNr">1689 </span> 5d/pop-to-ebp +<span id="L1690" class="LineNr">1690 </span> c3/return +<span id="L1691" class="LineNr">1691 </span> +<span id="L1692" class="LineNr">1692 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> </pre> </body> </html> |