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/072slice.subx.html | |
parent | 0fba3393a5becfb38dea19464e02dc17a64b7574 (diff) | |
download | mu-999c529cb972079df3bc693945be34a77336ddf4.tar.gz |
5716
Diffstat (limited to 'html/072slice.subx.html')
-rw-r--r-- | html/072slice.subx.html | 362 |
1 files changed, 180 insertions, 182 deletions
diff --git a/html/072slice.subx.html b/html/072slice.subx.html index 0d32e4e8..44136051 100644 --- a/html/072slice.subx.html +++ b/html/072slice.subx.html @@ -972,7 +972,7 @@ if ('onhashchange' in window) { <span id="L911" class="LineNr"> 911 </span> <span class="subxS2Comment"># . . push args</span> <span id="L912" class="LineNr"> 912 </span> 57/push-edi <span id="L913" class="LineNr"> 913 </span> <span class="subxS2Comment"># . . call</span> -<span id="L914" class="LineNr"> 914 </span> e8/call <a href='064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L914" class="LineNr"> 914 </span> e8/call <a href='064write-byte.subx.html#L81'>flush</a>/disp32 <span id="L915" class="LineNr"> 915 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L916" class="LineNr"> 916 </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="L917" class="LineNr"> 917 </span> <span class="subxS1Comment"># . clear-stream(stream = out+4)</span> @@ -1025,188 +1025,186 @@ if ('onhashchange' in window) { <span id="L964" class="LineNr"> 964 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 <span id="L965" class="LineNr"> 965 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L966" class="LineNr"> 966 </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="L967" class="LineNr"> 967 </span> <span class="subxS1Comment"># . clear-stream(_test-buffered-file+4)</span> +<span id="L967" class="LineNr"> 967 </span> <span class="subxS1Comment"># . clear-stream(_test-buffered-file->buffer)</span> <span id="L968" class="LineNr"> 968 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L969" class="LineNr"> 969 </span> b8/copy-to-eax <a href='061read-byte.subx.html#L281'>_test-buffered-file</a>/imm32 -<span id="L970" class="LineNr"> 970 </span> 05/add-to-eax 4/imm32 -<span id="L971" class="LineNr"> 971 </span> 50/push-eax -<span id="L972" class="LineNr"> 972 </span> <span class="subxS2Comment"># . . call</span> -<span id="L973" class="LineNr"> 973 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L974" class="LineNr"> 974 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L975" class="LineNr"> 975 </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="L976" class="LineNr"> 976 </span> <span class="subxComment"># (eax..ecx) = "Abc"</span> -<span id="L977" class="LineNr"> 977 </span> b8/copy-to-eax <span class="Constant">"Abc"</span>/imm32 -<span id="L978" class="LineNr"> 978 </span> 8b/copy 0/mod/indirect 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"># copy *eax to ecx</span> -<span id="L979" class="LineNr"> 979 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+4 to ecx</span> -<span id="L980" class="LineNr"> 980 </span> 05/add-to-eax 4/imm32 -<span id="L981" class="LineNr"> 981 </span> <span class="subxComment"># var slice/ecx = {eax, ecx}</span> -<span id="L982" class="LineNr"> 982 </span> 51/push-ecx -<span id="L983" class="LineNr"> 983 </span> 50/push-eax -<span id="L984" class="LineNr"> 984 </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="L985" class="LineNr"> 985 </span> <span class="subxComment"># write-slice-buffered(_test-buffered-file, slice)</span> -<span id="L986" class="LineNr"> 986 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L987" class="LineNr"> 987 </span> 51/push-ecx -<span id="L988" class="LineNr"> 988 </span> 68/push <a href='061read-byte.subx.html#L281'>_test-buffered-file</a>/imm32 -<span id="L989" class="LineNr"> 989 </span> <span class="subxS2Comment"># . . call</span> -<span id="L990" class="LineNr"> 990 </span> e8/call <a href='072slice.subx.html#L878'>write-slice-buffered</a>/disp32 -<span id="L991" class="LineNr"> 991 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L992" class="LineNr"> 992 </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="L993" class="LineNr"> 993 </span> <span class="subxComment"># flush(_test-buffered-file)</span> -<span id="L994" class="LineNr"> 994 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L995" class="LineNr"> 995 </span> 68/push <a href='061read-byte.subx.html#L281'>_test-buffered-file</a>/imm32 -<span id="L996" class="LineNr"> 996 </span> <span class="subxS2Comment"># . . call</span> -<span id="L997" class="LineNr"> 997 </span> e8/call <a href='064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L998" class="LineNr"> 998 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L999" class="LineNr"> 999 </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="L1000" class="LineNr">1000 </span> <span class="subxComment"># check-stream-equal(_test-stream, "Abc", msg)</span> -<span id="L1001" class="LineNr">1001 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1002" class="LineNr">1002 </span> 68/push <span class="Constant">"F - test-write-slice-buffered"</span>/imm32 -<span id="L1003" class="LineNr">1003 </span> 68/push <span class="Constant">"Abc"</span>/imm32 -<span id="L1004" class="LineNr">1004 </span> 68/push <a href='057write.subx.html#L148'>_test-stream</a>/imm32 -<span id="L1005" class="LineNr">1005 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1006" class="LineNr">1006 </span> e8/call <a href='058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 -<span id="L1007" class="LineNr">1007 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1008" class="LineNr">1008 </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="L1009" class="LineNr">1009 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1010" class="LineNr">1010 </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="L1011" class="LineNr">1011 </span> 5d/pop-to-ebp -<span id="L1012" class="LineNr">1012 </span> c3/return -<span id="L1013" class="LineNr">1013 </span> -<span id="L1014" class="LineNr">1014 </span><span class="subxComment"># copy a slice into a new (dynamically allocated) string</span> -<span id="L1015" class="LineNr">1015 </span><span class="subxFunction">slice-to-string</span>: <span class="subxComment"># ad : (address allocation-descriptor), in : (address slice) -> out/eax : (address array)</span> -<span id="L1016" class="LineNr">1016 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1017" class="LineNr">1017 </span> 55/push-ebp -<span id="L1018" class="LineNr">1018 </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="L1019" class="LineNr">1019 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L1020" class="LineNr">1020 </span> 51/push-ecx -<span id="L1021" class="LineNr">1021 </span> 52/push-edx -<span id="L1022" class="LineNr">1022 </span> 53/push-ebx -<span id="L1023" class="LineNr">1023 </span> 56/push-esi -<span id="L1024" class="LineNr">1024 </span> <span class="subxComment"># esi = in</span> -<span id="L1025" class="LineNr">1025 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L1026" class="LineNr">1026 </span> <span class="subxComment"># curr/edx = in->start</span> -<span id="L1027" class="LineNr">1027 </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="L1028" class="LineNr">1028 </span> <span class="subxComment"># max/ebx = in->end</span> -<span id="L1029" class="LineNr">1029 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ebx</span> -<span id="L1030" class="LineNr">1030 </span> <span class="subxComment"># size/ecx = max - curr + 4 # total size of output string (including the initial length)</span> -<span id="L1031" class="LineNr">1031 </span> 89/copy 3/mod/direct 1/rm32/ecx <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 ebx to ecx</span> -<span id="L1032" class="LineNr">1032 </span> 29/subtract 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"># subtract edx from ecx</span> -<span id="L1033" class="LineNr">1033 </span> 81 0/subop/add 3/mod/direct 1/rm32/ecx <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 ecx</span> -<span id="L1034" class="LineNr">1034 </span> <span class="subxComment"># out/eax = allocate(ad, size)</span> -<span id="L1035" class="LineNr">1035 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1036" class="LineNr">1036 </span> 51/push-ecx -<span id="L1037" class="LineNr">1037 </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> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span> -<span id="L1038" class="LineNr">1038 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1039" class="LineNr">1039 </span> e8/call <a href='069allocate.subx.html#L61'>allocate</a>/disp32 -<span id="L1040" class="LineNr">1040 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1041" class="LineNr">1041 </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="L1042" class="LineNr">1042 </span> <span class="subxComment"># if (eax == 0) abort</span> -<span id="L1043" class="LineNr">1043 </span> 3d/compare-eax-and 0/imm32 -<span id="L1044" class="LineNr">1044 </span> 74/jump-if-equal $slice-to-string:abort/disp8 -<span id="L1045" class="LineNr">1045 </span> <span class="subxComment"># *out = size-4</span> -<span id="L1046" class="LineNr">1046 </span> 89/copy 0/mod/indirect 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"># copy ecx to *eax</span> -<span id="L1047" class="LineNr">1047 </span> 81 5/subop/subtract 0/mod/indirect 0/rm32/eax <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"># subtract 4 from *eax</span> -<span id="L1048" class="LineNr">1048 </span> <span class="subxComment"># save out</span> -<span id="L1049" class="LineNr">1049 </span> 50/push-eax -<span id="L1050" class="LineNr">1050 </span> <span class="subxComment"># eax = _append-4(eax+4, eax+size, curr, max) # clobbering ecx</span> -<span id="L1051" class="LineNr">1051 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1052" class="LineNr">1052 </span> 53/push-ebx -<span id="L1053" class="LineNr">1053 </span> 52/push-edx -<span id="L1054" class="LineNr">1054 </span> <span class="subxS2Comment"># . . push eax+size (clobbering ecx)</span> -<span id="L1055" class="LineNr">1055 </span> 01/add 3/mod/direct 1/rm32/ecx <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"># add eax to ecx</span> -<span id="L1056" class="LineNr">1056 </span> 51/push-ecx -<span id="L1057" class="LineNr">1057 </span> <span class="subxS2Comment"># . . push eax+4 (clobbering eax)</span> -<span id="L1058" class="LineNr">1058 </span> 81 0/subop/add 3/mod/direct 0/rm32/eax <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 eax</span> -<span id="L1059" class="LineNr">1059 </span> 50/push-eax -<span id="L1060" class="LineNr">1060 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1061" class="LineNr">1061 </span> e8/call <a href='056trace.subx.html#L913'>_append-4</a>/disp32 -<span id="L1062" class="LineNr">1062 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1063" class="LineNr">1063 </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="L1064" class="LineNr">1064 </span> <span class="subxComment"># restore out (assumes _append-4 can't error)</span> -<span id="L1065" class="LineNr">1065 </span> 58/pop-to-eax -<span id="L1066" class="LineNr">1066 </span><span class="Constant">$slice-to-string:end</span>: -<span id="L1067" class="LineNr">1067 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L1068" class="LineNr">1068 </span> 5e/pop-to-esi -<span id="L1069" class="LineNr">1069 </span> 5b/pop-to-ebx -<span id="L1070" class="LineNr">1070 </span> 5a/pop-to-edx -<span id="L1071" class="LineNr">1071 </span> 59/pop-to-ecx -<span id="L1072" class="LineNr">1072 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1073" class="LineNr">1073 </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="L1074" class="LineNr">1074 </span> 5d/pop-to-ebp -<span id="L1075" class="LineNr">1075 </span> c3/return -<span id="L1076" class="LineNr">1076 </span> -<span id="L1077" class="LineNr">1077 </span><span class="Constant">$slice-to-string:abort</span>: -<span id="L1078" class="LineNr">1078 </span> <span class="subxS1Comment"># . _write(2/stderr, error)</span> -<span id="L1079" class="LineNr">1079 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1080" class="LineNr">1080 </span> 68/push <span class="Constant">"slice-to-string: out of space\n"</span>/imm32 -<span id="L1081" class="LineNr">1081 </span> 68/push 2/imm32/stderr -<span id="L1082" class="LineNr">1082 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1083" class="LineNr">1083 </span> e8/call <a href='050_write.subx.html#L14'>_write</a>/disp32 -<span id="L1084" class="LineNr">1084 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1085" class="LineNr">1085 </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="L1086" class="LineNr">1086 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> -<span id="L1087" class="LineNr">1087 </span> bb/copy-to-ebx 1/imm32 -<span id="L1088" class="LineNr">1088 </span> b8/copy-to-eax 1/imm32/exit -<span id="L1089" class="LineNr">1089 </span> cd/syscall 0x80/imm8 -<span id="L1090" class="LineNr">1090 </span> <span class="subxComment"># never gets here</span> -<span id="L1091" class="LineNr">1091 </span> -<span id="L1092" class="LineNr">1092 </span><span class="subxTest">test-slice-to-string</span>: -<span id="L1093" class="LineNr">1093 </span> <span class="subxS1Comment"># . prologue</span> -<span id="L1094" class="LineNr">1094 </span> 55/push-ebp -<span id="L1095" class="LineNr">1095 </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="L1096" class="LineNr">1096 </span> <span class="subxComment"># var heap/edx : (address allocation-descriptor) = {0, 0}</span> -<span id="L1097" class="LineNr">1097 </span> 68/push 0/imm32/limit -<span id="L1098" class="LineNr">1098 </span> 68/push 0/imm32/curr -<span id="L1099" class="LineNr">1099 </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="L1100" class="LineNr">1100 </span> <span class="subxComment"># heap = new-segment(512)</span> -<span id="L1101" class="LineNr">1101 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1102" class="LineNr">1102 </span> 52/push-edx -<span id="L1103" class="LineNr">1103 </span> 68/push 0x200/imm32 -<span id="L1104" class="LineNr">1104 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1105" class="LineNr">1105 </span> e8/call <a href='053new-segment.subx.html#L41'>new-segment</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> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L1108" class="LineNr">1108 </span> <span class="subxComment"># (eax..ecx) = "Abc"</span> -<span id="L1109" class="LineNr">1109 </span> b8/copy-to-eax <span class="Constant">"Abc"</span>/imm32 -<span id="L1110" class="LineNr">1110 </span> 8b/copy 0/mod/indirect 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"># copy *eax to ecx</span> -<span id="L1111" class="LineNr">1111 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+4 to ecx</span> -<span id="L1112" class="LineNr">1112 </span> 05/add-to-eax 4/imm32 -<span id="L1113" class="LineNr">1113 </span> <span class="subxComment"># var slice/ecx = {eax, ecx}</span> -<span id="L1114" class="LineNr">1114 </span> 51/push-ecx -<span id="L1115" class="LineNr">1115 </span> 50/push-eax -<span id="L1116" class="LineNr">1116 </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="L1117" class="LineNr">1117 </span> <span class="subxComment"># eax = slice-to-string(heap, slice)</span> -<span id="L1118" class="LineNr">1118 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1119" class="LineNr">1119 </span> 51/push-ecx -<span id="L1120" class="LineNr">1120 </span> 52/push-edx -<span id="L1121" class="LineNr">1121 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1122" class="LineNr">1122 </span> e8/call <a href='072slice.subx.html#L1015'>slice-to-string</a>/disp32 -<span id="L1123" class="LineNr">1123 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1124" class="LineNr">1124 </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="L1125" class="Folded">1125 </span><span class="Folded">+-- 26 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------</span> -<span id="L1151" class="LineNr">1151 </span> <span class="subxComment"># eax = string-equal?(eax, "Abc")</span> -<span id="L1152" class="LineNr">1152 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1153" class="LineNr">1153 </span> 68/push <span class="Constant">"Abc"</span>/imm32 -<span id="L1154" class="LineNr">1154 </span> 50/push-eax -<span id="L1155" class="LineNr">1155 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1156" class="LineNr">1156 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal?</a>/disp32 -<span id="L1157" class="LineNr">1157 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1158" class="LineNr">1158 </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="L1159" class="LineNr">1159 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span> -<span id="L1160" class="LineNr">1160 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1161" class="LineNr">1161 </span> 68/push <span class="Constant">"F - test-slice-to-string"</span>/imm32 -<span id="L1162" class="LineNr">1162 </span> 68/push 1/imm32/true -<span id="L1163" class="LineNr">1163 </span> 50/push-eax -<span id="L1164" class="LineNr">1164 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1165" class="LineNr">1165 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L1166" class="LineNr">1166 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1167" class="LineNr">1167 </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="L1168" class="LineNr">1168 </span> <span class="subxS1Comment"># . epilogue</span> -<span id="L1169" class="LineNr">1169 </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="L1170" class="LineNr">1170 </span> 5d/pop-to-ebp -<span id="L1171" class="LineNr">1171 </span> c3/return -<span id="L1172" class="LineNr">1172 </span> -<span id="L1173" class="LineNr">1173 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> +<span id="L969" class="LineNr"> 969 </span> 68/push <a href='061read-byte.subx.html#L278'>_test-buffered-file->buffer</a>/imm32 +<span id="L970" class="LineNr"> 970 </span> <span class="subxS2Comment"># . . call</span> +<span id="L971" class="LineNr"> 971 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L972" class="LineNr"> 972 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L973" class="LineNr"> 973 </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="L974" class="LineNr"> 974 </span> <span class="subxComment"># (eax..ecx) = "Abc"</span> +<span id="L975" class="LineNr"> 975 </span> b8/copy-to-eax <span class="Constant">"Abc"</span>/imm32 +<span id="L976" class="LineNr"> 976 </span> 8b/copy 0/mod/indirect 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"># copy *eax to ecx</span> +<span id="L977" class="LineNr"> 977 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+4 to ecx</span> +<span id="L978" class="LineNr"> 978 </span> 05/add-to-eax 4/imm32 +<span id="L979" class="LineNr"> 979 </span> <span class="subxComment"># var slice/ecx = {eax, ecx}</span> +<span id="L980" class="LineNr"> 980 </span> 51/push-ecx +<span id="L981" class="LineNr"> 981 </span> 50/push-eax +<span id="L982" class="LineNr"> 982 </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="L983" class="LineNr"> 983 </span> <span class="subxComment"># write-slice-buffered(_test-buffered-file, slice)</span> +<span id="L984" class="LineNr"> 984 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L985" class="LineNr"> 985 </span> 51/push-ecx +<span id="L986" class="LineNr"> 986 </span> 68/push <a href='061read-byte.subx.html#L275'>_test-buffered-file</a>/imm32 +<span id="L987" class="LineNr"> 987 </span> <span class="subxS2Comment"># . . call</span> +<span id="L988" class="LineNr"> 988 </span> e8/call <a href='072slice.subx.html#L878'>write-slice-buffered</a>/disp32 +<span id="L989" class="LineNr"> 989 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L990" class="LineNr"> 990 </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="L991" class="LineNr"> 991 </span> <span class="subxComment"># flush(_test-buffered-file)</span> +<span id="L992" class="LineNr"> 992 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L993" class="LineNr"> 993 </span> 68/push <a href='061read-byte.subx.html#L275'>_test-buffered-file</a>/imm32 +<span id="L994" class="LineNr"> 994 </span> <span class="subxS2Comment"># . . call</span> +<span id="L995" class="LineNr"> 995 </span> e8/call <a href='064write-byte.subx.html#L81'>flush</a>/disp32 +<span id="L996" class="LineNr"> 996 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L997" class="LineNr"> 997 </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="L998" class="LineNr"> 998 </span> <span class="subxComment"># check-stream-equal(_test-stream, "Abc", msg)</span> +<span id="L999" class="LineNr"> 999 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1000" class="LineNr">1000 </span> 68/push <span class="Constant">"F - test-write-slice-buffered"</span>/imm32 +<span id="L1001" class="LineNr">1001 </span> 68/push <span class="Constant">"Abc"</span>/imm32 +<span id="L1002" class="LineNr">1002 </span> 68/push <a href='057write.subx.html#L148'>_test-stream</a>/imm32 +<span id="L1003" class="LineNr">1003 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1004" class="LineNr">1004 </span> e8/call <a href='058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 +<span id="L1005" class="LineNr">1005 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1006" class="LineNr">1006 </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="L1007" class="LineNr">1007 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1008" class="LineNr">1008 </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="L1009" class="LineNr">1009 </span> 5d/pop-to-ebp +<span id="L1010" class="LineNr">1010 </span> c3/return +<span id="L1011" class="LineNr">1011 </span> +<span id="L1012" class="LineNr">1012 </span><span class="subxComment"># copy a slice into a new (dynamically allocated) string</span> +<span id="L1013" class="LineNr">1013 </span><span class="subxFunction">slice-to-string</span>: <span class="subxComment"># ad : (address allocation-descriptor), in : (address slice) -> out/eax : (address array)</span> +<span id="L1014" class="LineNr">1014 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1015" class="LineNr">1015 </span> 55/push-ebp +<span id="L1016" class="LineNr">1016 </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="L1017" class="LineNr">1017 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L1018" class="LineNr">1018 </span> 51/push-ecx +<span id="L1019" class="LineNr">1019 </span> 52/push-edx +<span id="L1020" class="LineNr">1020 </span> 53/push-ebx +<span id="L1021" class="LineNr">1021 </span> 56/push-esi +<span id="L1022" class="LineNr">1022 </span> <span class="subxComment"># esi = in</span> +<span id="L1023" class="LineNr">1023 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> +<span id="L1024" class="LineNr">1024 </span> <span class="subxComment"># curr/edx = in->start</span> +<span id="L1025" class="LineNr">1025 </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="L1026" class="LineNr">1026 </span> <span class="subxComment"># max/ebx = in->end</span> +<span id="L1027" class="LineNr">1027 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ebx</span> +<span id="L1028" class="LineNr">1028 </span> <span class="subxComment"># size/ecx = max - curr + 4 # total size of output string (including the initial length)</span> +<span id="L1029" class="LineNr">1029 </span> 89/copy 3/mod/direct 1/rm32/ecx <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 ebx to ecx</span> +<span id="L1030" class="LineNr">1030 </span> 29/subtract 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"># subtract edx from ecx</span> +<span id="L1031" class="LineNr">1031 </span> 81 0/subop/add 3/mod/direct 1/rm32/ecx <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 ecx</span> +<span id="L1032" class="LineNr">1032 </span> <span class="subxComment"># out/eax = allocate(ad, size)</span> +<span id="L1033" class="LineNr">1033 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1034" class="LineNr">1034 </span> 51/push-ecx +<span id="L1035" class="LineNr">1035 </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> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span> +<span id="L1036" class="LineNr">1036 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1037" class="LineNr">1037 </span> e8/call <a href='069allocate.subx.html#L61'>allocate</a>/disp32 +<span id="L1038" class="LineNr">1038 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1039" class="LineNr">1039 </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="L1040" class="LineNr">1040 </span> <span class="subxComment"># if (eax == 0) abort</span> +<span id="L1041" class="LineNr">1041 </span> 3d/compare-eax-and 0/imm32 +<span id="L1042" class="LineNr">1042 </span> 74/jump-if-equal $slice-to-string:abort/disp8 +<span id="L1043" class="LineNr">1043 </span> <span class="subxComment"># *out = size-4</span> +<span id="L1044" class="LineNr">1044 </span> 89/copy 0/mod/indirect 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"># copy ecx to *eax</span> +<span id="L1045" class="LineNr">1045 </span> 81 5/subop/subtract 0/mod/indirect 0/rm32/eax <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"># subtract 4 from *eax</span> +<span id="L1046" class="LineNr">1046 </span> <span class="subxComment"># save out</span> +<span id="L1047" class="LineNr">1047 </span> 50/push-eax +<span id="L1048" class="LineNr">1048 </span> <span class="subxComment"># eax = _append-4(eax+4, eax+size, curr, max) # clobbering ecx</span> +<span id="L1049" class="LineNr">1049 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1050" class="LineNr">1050 </span> 53/push-ebx +<span id="L1051" class="LineNr">1051 </span> 52/push-edx +<span id="L1052" class="LineNr">1052 </span> <span class="subxS2Comment"># . . push eax+size (clobbering ecx)</span> +<span id="L1053" class="LineNr">1053 </span> 01/add 3/mod/direct 1/rm32/ecx <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"># add eax to ecx</span> +<span id="L1054" class="LineNr">1054 </span> 51/push-ecx +<span id="L1055" class="LineNr">1055 </span> <span class="subxS2Comment"># . . push eax+4 (clobbering eax)</span> +<span id="L1056" class="LineNr">1056 </span> 81 0/subop/add 3/mod/direct 0/rm32/eax <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 eax</span> +<span id="L1057" class="LineNr">1057 </span> 50/push-eax +<span id="L1058" class="LineNr">1058 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1059" class="LineNr">1059 </span> e8/call <a href='056trace.subx.html#L913'>_append-4</a>/disp32 +<span id="L1060" class="LineNr">1060 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1061" class="LineNr">1061 </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="L1062" class="LineNr">1062 </span> <span class="subxComment"># restore out (assumes _append-4 can't error)</span> +<span id="L1063" class="LineNr">1063 </span> 58/pop-to-eax +<span id="L1064" class="LineNr">1064 </span><span class="Constant">$slice-to-string:end</span>: +<span id="L1065" class="LineNr">1065 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L1066" class="LineNr">1066 </span> 5e/pop-to-esi +<span id="L1067" class="LineNr">1067 </span> 5b/pop-to-ebx +<span id="L1068" class="LineNr">1068 </span> 5a/pop-to-edx +<span id="L1069" class="LineNr">1069 </span> 59/pop-to-ecx +<span id="L1070" class="LineNr">1070 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1071" class="LineNr">1071 </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="L1072" class="LineNr">1072 </span> 5d/pop-to-ebp +<span id="L1073" class="LineNr">1073 </span> c3/return +<span id="L1074" class="LineNr">1074 </span> +<span id="L1075" class="LineNr">1075 </span><span class="Constant">$slice-to-string:abort</span>: +<span id="L1076" class="LineNr">1076 </span> <span class="subxS1Comment"># . _write(2/stderr, error)</span> +<span id="L1077" class="LineNr">1077 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1078" class="LineNr">1078 </span> 68/push <span class="Constant">"slice-to-string: out of space\n"</span>/imm32 +<span id="L1079" class="LineNr">1079 </span> 68/push 2/imm32/stderr +<span id="L1080" class="LineNr">1080 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1081" class="LineNr">1081 </span> e8/call <a href='050_write.subx.html#L14'>_write</a>/disp32 +<span id="L1082" class="LineNr">1082 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1083" class="LineNr">1083 </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="L1084" class="LineNr">1084 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> +<span id="L1085" class="LineNr">1085 </span> bb/copy-to-ebx 1/imm32 +<span id="L1086" class="LineNr">1086 </span> b8/copy-to-eax 1/imm32/exit +<span id="L1087" class="LineNr">1087 </span> cd/syscall 0x80/imm8 +<span id="L1088" class="LineNr">1088 </span> <span class="subxComment"># never gets here</span> +<span id="L1089" class="LineNr">1089 </span> +<span id="L1090" class="LineNr">1090 </span><span class="subxTest">test-slice-to-string</span>: +<span id="L1091" class="LineNr">1091 </span> <span class="subxS1Comment"># . prologue</span> +<span id="L1092" class="LineNr">1092 </span> 55/push-ebp +<span id="L1093" class="LineNr">1093 </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="L1094" class="LineNr">1094 </span> <span class="subxComment"># var heap/edx : (address allocation-descriptor) = {0, 0}</span> +<span id="L1095" class="LineNr">1095 </span> 68/push 0/imm32/limit +<span id="L1096" class="LineNr">1096 </span> 68/push 0/imm32/curr +<span id="L1097" class="LineNr">1097 </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="L1098" class="LineNr">1098 </span> <span class="subxComment"># heap = new-segment(512)</span> +<span id="L1099" class="LineNr">1099 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1100" class="LineNr">1100 </span> 52/push-edx +<span id="L1101" class="LineNr">1101 </span> 68/push 0x200/imm32 +<span id="L1102" class="LineNr">1102 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1103" class="LineNr">1103 </span> e8/call <a href='053new-segment.subx.html#L41'>new-segment</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> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1106" class="LineNr">1106 </span> <span class="subxComment"># (eax..ecx) = "Abc"</span> +<span id="L1107" class="LineNr">1107 </span> b8/copy-to-eax <span class="Constant">"Abc"</span>/imm32 +<span id="L1108" class="LineNr">1108 </span> 8b/copy 0/mod/indirect 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"># copy *eax to ecx</span> +<span id="L1109" class="LineNr">1109 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+4 to ecx</span> +<span id="L1110" class="LineNr">1110 </span> 05/add-to-eax 4/imm32 +<span id="L1111" class="LineNr">1111 </span> <span class="subxComment"># var slice/ecx = {eax, ecx}</span> +<span id="L1112" class="LineNr">1112 </span> 51/push-ecx +<span id="L1113" class="LineNr">1113 </span> 50/push-eax +<span id="L1114" class="LineNr">1114 </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="L1115" class="LineNr">1115 </span> <span class="subxComment"># eax = slice-to-string(heap, slice)</span> +<span id="L1116" class="LineNr">1116 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1117" class="LineNr">1117 </span> 51/push-ecx +<span id="L1118" class="LineNr">1118 </span> 52/push-edx +<span id="L1119" class="LineNr">1119 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1120" class="LineNr">1120 </span> e8/call <a href='072slice.subx.html#L1013'>slice-to-string</a>/disp32 +<span id="L1121" class="LineNr">1121 </span> <span class="subxS2Comment"># . . discard args</span> +<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> 8/imm32 <span class="subxComment"># add to esp</span> +<span id="L1123" class="Folded">1123 </span><span class="Folded">+-- 26 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------</span> +<span id="L1149" class="LineNr">1149 </span> <span class="subxComment"># eax = string-equal?(eax, "Abc")</span> +<span id="L1150" class="LineNr">1150 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1151" class="LineNr">1151 </span> 68/push <span class="Constant">"Abc"</span>/imm32 +<span id="L1152" class="LineNr">1152 </span> 50/push-eax +<span id="L1153" class="LineNr">1153 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1154" class="LineNr">1154 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal?</a>/disp32 +<span id="L1155" class="LineNr">1155 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1156" class="LineNr">1156 </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="L1157" class="LineNr">1157 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span> +<span id="L1158" class="LineNr">1158 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1159" class="LineNr">1159 </span> 68/push <span class="Constant">"F - test-slice-to-string"</span>/imm32 +<span id="L1160" class="LineNr">1160 </span> 68/push 1/imm32/true +<span id="L1161" class="LineNr">1161 </span> 50/push-eax +<span id="L1162" class="LineNr">1162 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1163" class="LineNr">1163 </span> e8/call <a href='051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L1164" class="LineNr">1164 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1165" class="LineNr">1165 </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="L1166" class="LineNr">1166 </span> <span class="subxS1Comment"># . epilogue</span> +<span id="L1167" class="LineNr">1167 </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="L1168" class="LineNr">1168 </span> 5d/pop-to-ebp +<span id="L1169" class="LineNr">1169 </span> c3/return +<span id="L1170" class="LineNr">1170 </span> +<span id="L1171" class="LineNr">1171 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> </pre> </body> </html> |