about summary refs log blame commit diff stats
path: root/dwm.html
blob: d1602fb15989743fc400aedd738cd8ada25477cb (plain) (tree)
> . </span> <span class="subxComment"># copy *(ebp+12) to edx</span> <span id="L20" class="LineNr"> 20 </span> <span class="subxComment"># curr/ecx = arr-&gt;data</span> <span id="L21" class="LineNr"> 21 </span> 8d/copy-address 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edx+4 to ecx</span> <span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># max/edx = arr-&gt;data + arr-&gt;length</span> <span id="L23" class="LineNr"> 23 </span> 8b/copy 0/mod/indirect 2/rm32/edx <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 *edx to edx</span> <span id="L24" class="LineNr"> 24 </span> 01/add 3/mod/direct 2/rm32/edx <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"># add ecx to edx</span> <span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># eax = 0</span> <span id="L26" class="LineNr"> 26 </span> 31/xor 3/mod/direct 0/rm32/eax <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"># clear eax</span> <span id="L27" class="LineNr"> 27 </span><span class="Constant">$emit-hex-array:loop</span>: <span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># if (curr &gt;= width) break</span> <span id="L29" class="LineNr"> 29 </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="L30" class="LineNr"> 30 </span> 73/jump-if-greater-or-equal-unsigned $emit-hex-array:end/disp8 <span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># emit-hex(out, *curr, width=1)</span> <span id="L32" class="LineNr"> 32 </span> <span class="subxS2Comment"># . . push args</span> <span id="L33" class="LineNr"> 33 </span> 68/push 1/imm32/width <span id="L34" class="LineNr"> 34 </span> 8a/copy-byte 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/AL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *ecx to AL</span> <span id="L35" class="LineNr"> 35 </span> 50/push-eax <span id="L36" class="LineNr"> 36 </span> 57/push-edi <span id="L37" class="LineNr"> 37 </span> <span class="subxS2Comment"># . . call</span> <span id="L38" class="LineNr"> 38 </span> e8/call <a href='078emit-hex.subx.html#L7'>emit-hex</a>/disp32 <span id="L39" class="LineNr"> 39 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L40" class="LineNr"> 40 </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="L41" class="LineNr"> 41 </span> <span class="subxComment"># ++curr</span> <span id="L42" class="LineNr"> 42 </span> 41/increment-ecx <span id="L43" class="LineNr"> 43 </span> eb/jump $emit-hex-array:<span class="Constant">loop</span>/disp8 <span id="L44" class="LineNr"> 44 </span><span class="Constant">$emit-hex-array:end</span>: <span id="L45" class="LineNr"> 45 </span> <span class="subxS1Comment"># . restore registers</span> <span id="L46" class="LineNr"> 46 </span> 5f/pop-to-edi <span id="L47" class="LineNr"> 47 </span> 5a/pop-to-edx <span id="L48" class="LineNr"> 48 </span> 59/pop-to-ecx <span id="L49" class="LineNr"> 49 </span> 58/pop-to-eax <span id="L50" class="LineNr"> 50 </span> <span class="subxS1Comment"># . epilogue</span> <span id="L51" class="LineNr"> 51 </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="L52" class="LineNr"> 52 </span> 5d/pop-to-ebp <span id="L53" class="LineNr"> 53 </span> c3/return <span id="L54" class="LineNr"> 54 </span> <span id="L55" class="LineNr"> 55 </span><span class="subxTest">test-emit-hex-array</span>: <span id="L56" class="LineNr"> 56 </span> <span class="subxS1Comment"># . prologue</span> <span id="L57" class="LineNr"> 57 </span> 55/push-ebp <span id="L58" class="LineNr"> 58 </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="L59" class="LineNr"> 59 </span> <span class="subxComment"># setup</span> <span id="L60" class="LineNr"> 60 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> <span id="L61" class="LineNr"> 61 </span> <span class="subxS2Comment"># . . push args</span> <span id="L62" class="LineNr"> 62 </span> 68/push <a href='064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 <span id="L63" class="LineNr"> 63 </span> <span class="subxS2Comment"># . . call</span> <span id="L64" class="LineNr"> 64 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 <span id="L65" class="LineNr"> 65 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L66" class="LineNr"> 66 </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="L67" class="LineNr"> 67 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> <span id="L68" class="LineNr"> 68 </span> <span class="subxS2Comment"># . . push args</span> <span id="L69" class="LineNr"> 69 </span> b8/copy-to-eax <a href='064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 <span id="L70" class="LineNr"> 70 </span> 05/add-to-eax 4/imm32 <span id="L71" class="LineNr"> 71 </span> 50/push-eax <span id="L72" class="LineNr"> 72 </span> <span class="subxS2Comment"># . . call</span> <span id="L73" class="LineNr"> 73 </span> e8/call <a href='055stream.subx.html#L17'>clear-stream</a>/disp32 <span id="L74" class="LineNr"> 74 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L75" class="LineNr"> 75 </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="L76" class="LineNr"> 76 </span> <span class="subxComment"># var arr/ecx (address array byte) = [01, 02, 03]</span> <span id="L77" class="LineNr"> 77 </span> 68/push 0x00030201/imm32 <span class="subxComment"># bytes 01 02 03</span> <span id="L78" class="LineNr"> 78 </span> 68/push 3/imm32/length <span id="L79" class="LineNr"> 79 </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="L80" class="LineNr"> 80 </span> <span class="subxComment"># emit-hex-array(_test-output-buffered-file, arr)</span> <span id="L81" class="LineNr"> 81 </span> <span class="subxS2Comment"># . . push args</span> <span id="L82" class="LineNr"> 82 </span> 51/push-ecx <span id="L83" class="LineNr"> 83 </span> 68/push <a href='064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 <span id="L84" class="LineNr"> 84 </span> <span class="subxS2Comment"># . . call</span> <span id="L85" class="LineNr"> 85 </span> e8/call <a href='084emit-hex-array.subx.html#L7'>emit-hex-array</a>/disp32 <span id="L86" class="LineNr"> 86 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L87" class="LineNr"> 87 </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="L88" class="LineNr"> 88 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> <span id="L89" class="LineNr"> 89 </span> <span class="subxS2Comment"># . . push args</span> <span id="L90" class="LineNr"> 90 </span> 68/push <a href='064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 <span id="L91" class="LineNr"> 91 </span> <span class="subxS2Comment"># . . call</span> <span id="L92" class="LineNr"> 92 </span> e8/call <a href='064write-byte.subx.html#L79'>flush</a>/disp32 <span id="L93" class="LineNr"> 93 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L94" class="LineNr"> 94 </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="L95" class="Folded"> 95 </span><span class="Folded">+-- 33 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> <span id="L128" class="LineNr">128 </span> <span class="subxComment"># check-next-stream-line-equal(_test-output-stream, &quot;01 02 03 &quot;, msg)</span> <span id="L129" class="LineNr">129 </span> <span class="subxS2Comment"># . . push args</span> <span id="L130" class="LineNr">130 </span> 68/push <span class="Constant">&quot;F - test-emit-hex-array&quot;</span>/imm32 <span id="L131" class="LineNr">131 </span> 68/push <span class="Constant">&quot;01 02 03 &quot;</span>/imm32 <span id="L132" class="LineNr">132 </span> 68/push <a href='064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 <span id="L133" class="LineNr">133 </span> <span class="subxS2Comment"># . . call</span> <span id="L134" class="LineNr">134 </span> e8/call <a href='058stream-equal.subx.html#L563'>check-next-stream-line-equal</a>/disp32 <span id="L135" class="LineNr">135 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L136" class="LineNr">136 </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="L137" class="LineNr">137 </span> <span class="subxS1Comment"># . epilogue</span> <span id="L138" class="LineNr">138 </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="L139" class="LineNr">139 </span> 5d/pop-to-ebp <span id="L140" class="LineNr">140 </span> c3/return <span id="L141" class="LineNr">141 </span> <span id="L142" class="LineNr">142 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span> </pre> </body> </html> <!-- vim: set foldmethod=manual : -->