diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-02-14 23:00:47 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-02-14 23:00:47 -0800 |
commit | 9309600c5a8a5a86ac5aeebdee7bf0656409fc26 (patch) | |
tree | 3b9420b7a4af72a85401fbce4a90e9a9c88dc85b /html/subx/examples/ex10.subx.html | |
parent | db2be4dd83ebfb37dc44873aa1a15ae0da47c15d (diff) | |
download | mu-9309600c5a8a5a86ac5aeebdee7bf0656409fc26.tar.gz |
4967
Diffstat (limited to 'html/subx/examples/ex10.subx.html')
-rw-r--r-- | html/subx/examples/ex10.subx.html | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/html/subx/examples/ex10.subx.html b/html/subx/examples/ex10.subx.html index 49383f99..6d48a9c2 100644 --- a/html/subx/examples/ex10.subx.html +++ b/html/subx/examples/ex10.subx.html @@ -96,37 +96,36 @@ if ('onhashchange' in window) { <span id="L38" class="LineNr">38 </span> <span class="subxComment"># initialize s1 (ECX) and s2 (EDX)</span> <span id="L39" class="LineNr">39 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ESP+4) to ECX</span> <span id="L40" class="LineNr">40 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none <span class="Normal"> . </span> 2/r32/EDX 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ESP+8) to EDX</span> -<span id="L41" class="LineNr">41 </span> <span class="subxComment"># while (true)</span> -<span id="L42" class="LineNr">42 </span><span class="Constant">$argv-equal:loop</span>: -<span id="L43" class="LineNr">43 </span> <span class="subxComment"># c1/EAX, c2/EBX = *s1, *s2</span> -<span id="L44" class="LineNr">44 </span> b8/copy-to-EAX 0/imm32 -<span id="L45" class="LineNr">45 </span> 8a/copy 0/mod/indirect 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"># copy byte at *ECX to lower byte of EAX</span> -<span id="L46" class="LineNr">46 </span> bb/copy-to-EBX 0/imm32 -<span id="L47" class="LineNr">47 </span> 8a/copy 0/mod/indirect 2/rm32/EDX <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 byte at *EDX to lower byte of EBX</span> -<span id="L48" class="LineNr">48 </span> <span class="subxComment"># if (c1 == 0) break</span> -<span id="L49" class="LineNr">49 </span> 3d/compare-EAX 0/imm32 -<span id="L50" class="LineNr">50 </span> 74/jump-if-equal $argv-equal:break/disp8 -<span id="L51" class="LineNr">51 </span> <span class="subxComment"># if (c1 != c2) return false</span> -<span id="L52" class="LineNr">52 </span> 39/compare 3/mod/direct 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"># compare EAX with EBX</span> -<span id="L53" class="LineNr">53 </span> 75/jump-if-not-equal $argv-equal:false/disp8 -<span id="L54" class="LineNr">54 </span> <span class="subxComment"># ++s1, ++s2</span> -<span id="L55" class="LineNr">55 </span> 41/inc-ECX -<span id="L56" class="LineNr">56 </span> 42/inc-EDX -<span id="L57" class="LineNr">57 </span> <span class="subxComment"># end while</span> -<span id="L58" class="LineNr">58 </span> eb/jump $argv-equal:loop/disp8 -<span id="L59" class="LineNr">59 </span><span class="Constant">$argv-equal:break</span>: -<span id="L60" class="LineNr">60 </span> <span class="subxComment"># if (c2 == 0) return true</span> -<span id="L61" class="LineNr">61 </span> 81 7/subop/compare 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># compare EBX</span> -<span id="L62" class="LineNr">62 </span> 75/jump-if-not-equal $argv-equal:false/disp8 -<span id="L63" class="LineNr">63 </span><span class="Constant">$argv-equal:success</span>: -<span id="L64" class="LineNr">64 </span> b8/copy-to-EAX 1/imm32 -<span id="L65" class="LineNr">65 </span> c3/return -<span id="L66" class="LineNr">66 </span> <span class="subxComment"># return false</span> -<span id="L67" class="LineNr">67 </span><span class="Constant">$argv-equal:false</span>: -<span id="L68" class="LineNr">68 </span> b8/copy-to-EAX 0/imm32 -<span id="L69" class="LineNr">69 </span> c3/return -<span id="L70" class="LineNr">70 </span> -<span id="L71" class="LineNr">71 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> +<span id="L41" class="LineNr">41 </span><span class="Constant">$argv-equal:loop</span>: +<span id="L42" class="LineNr">42 </span> <span class="subxComment"># c1/EAX, c2/EBX = *s1, *s2</span> +<span id="L43" class="LineNr">43 </span> b8/copy-to-EAX 0/imm32 +<span id="L44" class="LineNr">44 </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="L45" class="LineNr">45 </span> bb/copy-to-EBX 0/imm32 +<span id="L46" class="LineNr">46 </span> 8a/copy-byte 0/mod/indirect 2/rm32/EDX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/BL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *EDX to BL</span> +<span id="L47" class="LineNr">47 </span> <span class="subxComment"># if (c1 == 0) break</span> +<span id="L48" class="LineNr">48 </span> 3d/compare-EAX 0/imm32 +<span id="L49" class="LineNr">49 </span> 74/jump-if-equal $argv-equal:break/disp8 +<span id="L50" class="LineNr">50 </span> <span class="subxComment"># if (c1 != c2) return false</span> +<span id="L51" class="LineNr">51 </span> 39/compare 3/mod/direct 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"># compare EAX with EBX</span> +<span id="L52" class="LineNr">52 </span> 75/jump-if-not-equal $argv-equal:false/disp8 +<span id="L53" class="LineNr">53 </span> <span class="subxComment"># ++s1, ++s2</span> +<span id="L54" class="LineNr">54 </span> 41/inc-ECX +<span id="L55" class="LineNr">55 </span> 42/inc-EDX +<span id="L56" class="LineNr">56 </span> <span class="subxComment"># end while</span> +<span id="L57" class="LineNr">57 </span> eb/jump $argv-equal:loop/disp8 +<span id="L58" class="LineNr">58 </span><span class="Constant">$argv-equal:break</span>: +<span id="L59" class="LineNr">59 </span> <span class="subxComment"># if (c2 == 0) return true</span> +<span id="L60" class="LineNr">60 </span> 81 7/subop/compare 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># compare EBX</span> +<span id="L61" class="LineNr">61 </span> 75/jump-if-not-equal $argv-equal:false/disp8 +<span id="L62" class="LineNr">62 </span><span class="Constant">$argv-equal:success</span>: +<span id="L63" class="LineNr">63 </span> b8/copy-to-EAX 1/imm32 +<span id="L64" class="LineNr">64 </span> c3/return +<span id="L65" class="LineNr">65 </span> <span class="subxComment"># return false</span> +<span id="L66" class="LineNr">66 </span><span class="Constant">$argv-equal:false</span>: +<span id="L67" class="LineNr">67 </span> b8/copy-to-EAX 0/imm32 +<span id="L68" class="LineNr">68 </span> c3/return +<span id="L69" class="LineNr">69 </span> +<span id="L70" class="LineNr">70 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> </pre> </body> </html> |