about summary refs log blame commit diff stats
path: root/subx/024pack_operands.cc
blob: 2657339566e39cdb57512100576f992c22bc3339 (plain) (tree)
;LineNr"> 94 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L95" class="LineNr"> 95 </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="L96" class="LineNr"> 96 </span> <span class="subxComment"># var buffer/ecx: (stream byte 10) # number of decimal digits a 32-bit number can have</span> <span id="L97" class="LineNr"> 97 </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> 0xa/imm32 <span class="subxComment"># subtract from esp</span> <span id="L98" class="LineNr"> 98 </span> 68/push 0xa/imm32/decimal-digits-in-32bit-number <span id="L99" class="LineNr"> 99 </span> 68/push 0/imm32/read <span id="L100" class="LineNr">100 </span> 68/push 0/imm32/write <span id="L101" class="LineNr">101 </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="L102" class="LineNr">102 </span> <span class="subxComment"># write-int32-decimal(buffer, eax)</span> <span id="L103" class="LineNr">103 </span> <span class="subxS2Comment"># . . push args</span> <span id="L104" class="LineNr">104 </span> 50/push-eax <span id="L105" class="LineNr">105 </span> 51/push-ecx <span id="L106" class="LineNr">106 </span> <span class="subxS2Comment"># . . call</span> <span id="L107" class="LineNr">107 </span> e8/call <a href='../126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32 <span id="L108" class="LineNr">108 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L109" class="LineNr">109 </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="L110" class="LineNr">110 </span> <span class="subxComment"># write-stream(stderr, buffer)</span> <span id="L111" class="LineNr">111 </span> <span class="subxS2Comment"># . . push args</span> <span id="L112" class="LineNr">112 </span> 51/push-ecx <span id="L113" class="LineNr">113 </span> 68/push 2/imm32/stderr <span id="L114" class="LineNr">114 </span> <span class="subxS2Comment"># . . call</span> <span id="L115" class="LineNr">115 </span> e8/call <a href='../113write-stream.subx.html#L17'>write-stream</a>/disp32 <span id="L116" class="LineNr">116 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L117" class="LineNr">117 </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="L118" class="LineNr">118 </span> <span class="subxComment"># write(stderr, Newline)</span> <span id="L119" class="LineNr">119 </span> <span class="subxS2Comment"># . . push args</span> <span id="L120" class="LineNr">120 </span> 68/push <span class="SpecialChar"><a href='../102test.subx.html#L82'>Newline</a></span>/imm32 <span id="L121" class="LineNr">121 </span> 68/push 2/imm32/stderr <span id="L122" class="LineNr">122 </span> <span class="subxS2Comment"># . . call</span> <span id="L123" class="LineNr">123 </span> e8/call <a href='../108write.subx.html#L24'>write</a>/disp32 <span id="L124" class="LineNr">124 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L125" class="LineNr">125 </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="L126" class="LineNr">126 </span> <span class="subxComment">#</span> <span id="L127" class="LineNr">127 </span> 89/copy 3/mod/direct 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="L128" class="LineNr">128 </span> eb/jump $main:end/disp8 <span id="L129" class="LineNr">129 </span><span class="Constant">$main:run-tests</span>: <span id="L130" class="LineNr">130 </span> <span class="subxComment"># otherwise if first arg is &quot;test&quot;, then return run_tests()</span> <span id="L131" class="LineNr">131 </span> <span class="subxComment"># if (!kernel-string-equal?(argv[1], &quot;test&quot;)) goto do-nothing</span> <span id="L132" class="LineNr">132 </span> <span class="subxS1Comment"># . eax = kernel-string-equal?(argv[1], &quot;test&quot;)</span> <span id="L133" class="LineNr">133 </span> <span class="subxS2Comment"># . . push args</span> <span id="L134" class="LineNr">134 </span> 68/push <span class="Constant">&quot;test&quot;</span>/imm32 <span id="L135" class="LineNr">135 </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="L136" class="LineNr">136 </span> <span class="subxS2Comment"># . . call</span> <span id="L137" class="LineNr">137 </span> e8/call <a href='../103kernel-string-equal.subx.html#L31'>kernel-string-equal?</a>/disp32 <span id="L138" class="LineNr">138 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L139" class="LineNr">139 </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="L140" class="LineNr">140 </span> <span class="subxS1Comment"># . if (eax == false) goto do-nothing</span> <span id="L141" class="LineNr">141 </span> 3d/compare-eax-and 0/imm32/false <span id="L142" class="LineNr">142 </span> 74/jump-if-= $main:do-nothing/disp8 <span id="L143" class="LineNr">143 </span> <span class="subxComment"># run-tests()</span> <span id="L144" class="LineNr">144 </span> e8/call run-tests/disp32 <span id="L145" class="LineNr">145 </span> <span class="subxComment"># exit(*Num-test-failures)</span> <span id="L146" class="LineNr">146 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="SpecialChar"><a href='../102test.subx.html#L89'>Num-test-failures</a></span>/disp32 <span class="subxComment"># copy *Num-test-failures to ebx</span> <span id="L147" class="LineNr">147 </span> eb/jump $main:end/disp8 <span id="L148" class="LineNr">148 </span><span class="Constant">$main:do-nothing</span>: <span id="L149" class="LineNr">149 </span> bb/copy-to-ebx 0/imm32 <span id="L150" class="LineNr">150 </span><span class="Constant">$main:end</span>: <span id="L151" class="LineNr">151 </span> e8/call <a href='../000init.subx.html#L18'>syscall_exit</a>/disp32 <span id="L152" class="LineNr">152 </span> <span id="L153" class="LineNr">153 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span> </pre> </body> </html> <!-- vim: set foldmethod=manual : -->