diff options
Diffstat (limited to 'html/subx/055trace.subx.html')
-rw-r--r-- | html/subx/055trace.subx.html | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/html/subx/055trace.subx.html b/html/subx/055trace.subx.html index bd3ec9c0..4e92ea63 100644 --- a/html/subx/055trace.subx.html +++ b/html/subx/055trace.subx.html @@ -23,6 +23,9 @@ body { font-size:12pt; font-family: monospace; color: #aaaaaa; background-color: .LineNr { color:#444444; } .subxS1Comment { color:#2d8cff; } .SpecialChar { color: #ff0000; } +.subxFunction { color: #ff8700; } +.subxTest { color: #00af00; } +.subxMinorFunction { color: #875f5f; } .Constant { color:#00a0a0; } .CommentedCode { color: #6c6c6c; } .subxH1Comment { color:#00ffff; } @@ -90,7 +93,7 @@ if ('onhashchange' in window) { <span id="L27" class="LineNr"> 27 </span> <span id="L28" class="LineNr"> 28 </span><span class="subxComment"># Fake trace-stream for tests.</span> <span id="L29" class="LineNr"> 29 </span><span class="subxComment"># Also illustrates the layout of the real trace-stream (segment).</span> -<span id="L30" class="LineNr"> 30 </span>_test-trace-stream: +<span id="L30" class="LineNr"> 30 </span><span class="subxMinorFunction">_test-trace-stream</span>: <span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># current write index</span> <span id="L32" class="LineNr"> 32 </span> 00 00 00 00 <span id="L33" class="LineNr"> 33 </span> <span class="subxComment"># current read index</span> @@ -115,7 +118,7 @@ if ('onhashchange' in window) { <span id="L52" class="LineNr"> 52 </span> <span id="L53" class="LineNr"> 53 </span><span class="subxComment"># Allocate a new segment for the trace stream, initialize its length, and save its address to Trace-stream.</span> <span id="L54" class="LineNr"> 54 </span><span class="subxComment"># The Trace-stream segment will consist of variable-length lines separated by newlines (0x0a)</span> -<span id="L55" class="LineNr"> 55 </span>initialize-trace-stream: +<span id="L55" class="LineNr"> 55 </span><span class="subxFunction">initialize-trace-stream</span>: <span id="L56" class="LineNr"> 56 </span> <span class="subxComment"># EAX = new-segment(0x1000)</span> <span id="L57" class="LineNr"> 57 </span> <span class="subxS2Comment"># . . push args</span> <span id="L58" class="LineNr"> 58 </span> 68/push 0x1000/imm32/N @@ -131,7 +134,7 @@ if ('onhashchange' in window) { <span id="L68" class="LineNr"> 68 </span> <span id="L69" class="LineNr"> 69 </span><span class="subxComment"># Append a string to the given trace stream.</span> <span id="L70" class="LineNr"> 70 </span><span class="subxComment"># Silently give up if it's already full. Or truncate the string if there isn't enough room.</span> -<span id="L71" class="LineNr"> 71 </span>trace: <span class="subxComment"># t : (address trace-stream), line : string</span> +<span id="L71" class="LineNr"> 71 </span><span class="subxFunction">trace</span>: <span class="subxComment"># t : (address trace-stream), line : string</span> <span id="L72" class="LineNr"> 72 </span> <span class="subxS1Comment"># . prolog</span> <span id="L73" class="LineNr"> 73 </span> 55/push-EBP <span id="L74" class="LineNr"> 74 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/r32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy ESP to EBP</span> @@ -185,7 +188,7 @@ if ('onhashchange' in window) { <span id="L122" class="LineNr">122 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> <span id="L123" class="LineNr">123 </span> <span class="subxComment"># t->write += EAX</span> <span id="L124" class="LineNr">124 </span> 01/add 0/mod/indirect 7/rm32/EDI <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0/r32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># add EAX to *EDI</span> -<span id="L125" class="LineNr">125 </span>$trace:end: +<span id="L125" class="LineNr">125 </span><span class="Constant">$trace:end</span>: <span id="L126" class="LineNr">126 </span> <span class="subxS1Comment"># . restore registers</span> <span id="L127" class="LineNr">127 </span> 5f/pop-to-EDI <span id="L128" class="LineNr">128 </span> 5e/pop-to-ESI @@ -198,7 +201,7 @@ if ('onhashchange' in window) { <span id="L135" class="LineNr">135 </span> 5d/pop-to-EBP <span id="L136" class="LineNr">136 </span> c3/return <span id="L137" class="LineNr">137 </span> -<span id="L138" class="LineNr">138 </span>clear-trace-stream: <span class="subxComment"># t : (address trace-stream)</span> +<span id="L138" class="LineNr">138 </span><span class="subxFunction">clear-trace-stream</span>: <span class="subxComment"># t : (address trace-stream)</span> <span id="L139" class="LineNr">139 </span> <span class="subxS1Comment"># . prolog</span> <span id="L140" class="LineNr">140 </span> 55/push-EBP <span id="L141" class="LineNr">141 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/r32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy ESP to EBP</span> @@ -218,7 +221,7 @@ if ('onhashchange' in window) { <span id="L155" class="LineNr">155 </span> <span class="subxComment"># EAX = t->data</span> <span id="L156" class="LineNr">156 </span> 81 0/subop/add 3/mod/direct 0/rm32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0xc/imm32 <span class="subxComment"># add to EAX</span> <span id="L157" class="LineNr">157 </span> <span class="subxComment"># while (true)</span> -<span id="L158" class="LineNr">158 </span>$clear-trace-stream:loop: +<span id="L158" class="LineNr">158 </span><span class="Constant">$clear-trace-stream:loop</span>: <span id="L159" class="LineNr">159 </span> <span class="subxComment"># if EAX >= ECX break</span> <span id="L160" class="LineNr">160 </span> 39/compare 3/mod/direct 0/rm32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 1/r32/ECX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># compare EAX with ECX</span> <span id="L161" class="LineNr">161 </span> 7d/jump-if-greater-or-equal $clear-trace-stream:end/disp8 @@ -227,7 +230,7 @@ if ('onhashchange' in window) { <span id="L164" class="LineNr">164 </span> <span class="subxComment"># EAX += 4</span> <span id="L165" class="LineNr">165 </span> 81 0/subop/add 3/mod/direct 0/rm32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/imm32 <span class="subxComment"># add to EAX</span> <span id="L166" class="LineNr">166 </span> eb/jump $clear-trace-stream:loop/disp8 -<span id="L167" class="LineNr">167 </span>$clear-trace-stream:end: +<span id="L167" class="LineNr">167 </span><span class="Constant">$clear-trace-stream:end</span>: <span id="L168" class="LineNr">168 </span> <span class="subxS1Comment"># . restore registers</span> <span id="L169" class="LineNr">169 </span> 59/pop-to-ECX <span id="L170" class="LineNr">170 </span> 58/pop-to-EAX @@ -238,7 +241,7 @@ if ('onhashchange' in window) { <span id="L175" class="LineNr">175 </span> <span id="L176" class="LineNr">176 </span><span class="subxH1Comment"># - tests</span> <span id="L177" class="LineNr">177 </span> -<span id="L178" class="LineNr">178 </span>test-trace-single: +<span id="L178" class="LineNr">178 </span><span class="subxTest">test-trace-single</span>: <span id="L179" class="LineNr">179 </span> <span class="subxComment"># clear-trace-stream(_test-trace-stream)</span> <span id="L180" class="LineNr">180 </span> <span class="subxS2Comment"># . . push args</span> <span id="L181" class="LineNr">181 </span> 68/push _test-trace-stream/imm32 @@ -268,7 +271,7 @@ if ('onhashchange' in window) { <span id="L205" class="LineNr">205 </span> <span class="subxComment"># end</span> <span id="L206" class="LineNr">206 </span> c3/return <span id="L207" class="LineNr">207 </span> -<span id="L208" class="LineNr">208 </span>test-trace-appends: +<span id="L208" class="LineNr">208 </span><span class="subxTest">test-trace-appends</span>: <span id="L209" class="LineNr">209 </span> <span class="subxComment"># clear-trace-stream(_test-trace-stream)</span> <span id="L210" class="LineNr">210 </span> <span class="subxS2Comment"># . . push args</span> <span id="L211" class="LineNr">211 </span> 68/push _test-trace-stream/imm32 @@ -306,7 +309,7 @@ if ('onhashchange' in window) { <span id="L243" class="LineNr">243 </span> <span class="subxComment"># end</span> <span id="L244" class="LineNr">244 </span> c3/return <span id="L245" class="LineNr">245 </span> -<span id="L246" class="LineNr">246 </span>test-trace-empty-line: +<span id="L246" class="LineNr">246 </span><span class="subxTest">test-trace-empty-line</span>: <span id="L247" class="LineNr">247 </span> <span class="subxComment"># clear-trace-stream(_test-trace-stream)</span> <span id="L248" class="LineNr">248 </span> <span class="subxS2Comment"># . . push args</span> <span id="L249" class="LineNr">249 </span> 68/push _test-trace-stream/imm32 @@ -339,7 +342,7 @@ if ('onhashchange' in window) { <span id="L276" class="LineNr">276 </span><span class="subxH1Comment"># - helpers</span> <span id="L277" class="LineNr">277 </span> <span id="L278" class="LineNr">278 </span><span class="subxComment"># 3-argument variant of _append</span> -<span id="L279" class="LineNr">279 </span>_append-3: <span class="subxComment"># out : address, outend : address, s : (array byte) -> num_bytes_appended/EAX</span> +<span id="L279" class="LineNr">279 </span><span class="subxMinorFunction">_append-3</span>: <span class="subxComment"># out : address, outend : address, s : (array byte) -> num_bytes_appended/EAX</span> <span id="L280" class="LineNr">280 </span> <span class="subxS1Comment"># . prolog</span> <span id="L281" class="LineNr">281 </span> 55/push-EBP <span id="L282" class="LineNr">282 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/r32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy ESP to EBP</span> @@ -370,7 +373,7 @@ if ('onhashchange' in window) { <span id="L307" class="LineNr">307 </span> c3/return <span id="L308" class="LineNr">308 </span> <span id="L309" class="LineNr">309 </span><span class="subxComment"># 4-argument variant of _append</span> -<span id="L310" class="LineNr">310 </span>_append-4: <span class="subxComment"># out : address, outend : address, in : address, inend : address -> num_bytes_appended/EAX</span> +<span id="L310" class="LineNr">310 </span><span class="subxMinorFunction">_append-4</span>: <span class="subxComment"># out : address, outend : address, in : address, inend : address -> num_bytes_appended/EAX</span> <span id="L311" class="LineNr">311 </span> <span class="subxS1Comment"># . prolog</span> <span id="L312" class="LineNr">312 </span> 55/push-EBP <span id="L313" class="LineNr">313 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/r32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy ESP to EBP</span> @@ -390,7 +393,7 @@ if ('onhashchange' in window) { <span id="L327" class="LineNr">327 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none <span class="CommentedCode"> . </span> 6/r32/ESI 0x10/disp8 <span class="CommentedCode"> . </span> <span class="subxComment"># copy *(EBP+16) to ESI</span> <span id="L328" class="LineNr">328 </span> <span class="subxComment"># ECX = inend</span> <span id="L329" class="LineNr">329 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none <span class="CommentedCode"> . </span> 1/r32/ECX 0x14/disp8 <span class="CommentedCode"> . </span> <span class="subxComment"># copy *(EBP+20) to ECX</span> -<span id="L330" class="LineNr">330 </span>$_append-4:loop: +<span id="L330" class="LineNr">330 </span><span class="Constant">$_append-4:loop</span>: <span id="L331" class="LineNr">331 </span> <span class="subxComment"># if ESI/src >= ECX/srcend break</span> <span id="L332" class="LineNr">332 </span> 39/compare 3/mod/direct 6/rm32/ESI <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 1/r32/ECX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># compare ESI with ECX</span> <span id="L333" class="LineNr">333 </span> 7d/jump-if-greater-or-equal $_append-4:end/disp8 @@ -405,7 +408,7 @@ if ('onhashchange' in window) { <span id="L342" class="LineNr">342 </span> 46/increment-ESI <span id="L343" class="LineNr">343 </span> 47/increment-EDI <span id="L344" class="LineNr">344 </span> eb/jump $_append-4:loop/disp8 -<span id="L345" class="LineNr">345 </span>$_append-4:end: +<span id="L345" class="LineNr">345 </span><span class="Constant">$_append-4:end</span>: <span id="L346" class="LineNr">346 </span> <span class="subxS1Comment"># . restore registers</span> <span id="L347" class="LineNr">347 </span> 5f/pop-to-EDI <span id="L348" class="LineNr">348 </span> 5e/pop-to-ESI |