diff options
Diffstat (limited to 'html/013direct_addressing.cc.html')
-rw-r--r-- | html/013direct_addressing.cc.html | 260 |
1 files changed, 130 insertions, 130 deletions
diff --git a/html/013direct_addressing.cc.html b/html/013direct_addressing.cc.html index 109ef0db..8944da91 100644 --- a/html/013direct_addressing.cc.html +++ b/html/013direct_addressing.cc.html @@ -2,7 +2,7 @@ <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> -<title>Mu - subx/013direct_addressing.cc</title> +<title>Mu - 013direct_addressing.cc</title> <meta name="Generator" content="Vim/8.1"> <meta name="plugin-version" content="vim8.1_v1"> <meta name="syntax" content="cpp"> @@ -57,18 +57,18 @@ if ('onhashchange' in window) { </script> </head> <body onload='JumpToLine();'> -<a href='https://github.com/akkartik/mu/blob/master/subx/013direct_addressing.cc'>https://github.com/akkartik/mu/blob/master/subx/013direct_addressing.cc</a> +<a href='https://github.com/akkartik/mu/blob/master/013direct_addressing.cc'>https://github.com/akkartik/mu/blob/master/013direct_addressing.cc</a> <pre id='vimCodeElement'> <span id="L1" class="LineNr"> 1 </span><span class="Comment">//: operating directly on a register</span> <span id="L2" class="LineNr"> 2 </span> <span id="L3" class="LineNr"> 3 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L4" class="LineNr"> 4 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"01"</span><span class="Delimiter">,</span> <span class="Constant">"add r32 to rm32 (add)"</span><span class="Delimiter">);</span> +<span id="L4" class="LineNr"> 4 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"01"</span><span class="Delimiter">,</span> <span class="Constant">"add r32 to rm32 (add)"</span><span class="Delimiter">);</span> <span id="L5" class="LineNr"> 5 </span> <span id="L6" class="LineNr"> 6 </span><span class="Delimiter">:(code)</span> <span id="L7" class="LineNr"> 7 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L7'>test_add_r32_to_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L8" class="LineNr"> 8 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x10</span><span class="Delimiter">;</span> <span id="L9" class="LineNr"> 9 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L10" class="LineNr"> 10 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L10" class="LineNr"> 10 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L11" class="LineNr"> 11 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L12" class="LineNr"> 12 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L13" class="LineNr"> 13 </span> <span class="Constant">" 01 d8 \n"</span> <span class="Comment">// add EBX to EAX</span> @@ -83,7 +83,7 @@ if ('onhashchange' in window) { <span id="L22" class="LineNr"> 22 </span> <span id="L23" class="LineNr"> 23 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L24" class="LineNr"> 24 </span><span class="Normal">case</span> <span class="Constant">0x01</span>: <span class="Delimiter">{</span> <span class="Comment">// add r32 to r/m32</span> -<span id="L25" class="LineNr"> 25 </span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L25" class="LineNr"> 25 </span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L26" class="LineNr"> 26 </span> <span class="Normal">uint8_t</span> arg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L27" class="LineNr"> 27 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"add "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>arg2<span class="Delimiter">)</span> << <span class="Constant">" to r/m32"</span> << end<span class="Delimiter">();</span> <span id="L28" class="LineNr"> 28 </span> <span class="Normal">int32_t</span>* signed_arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> @@ -99,7 +99,7 @@ if ('onhashchange' in window) { <span id="L38" class="LineNr"> 38 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Delimiter">(</span>unsigned_result != unsigned_full_result<span class="Delimiter">);</span> <span id="L39" class="LineNr"> 39 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"SF="</span> << SF << <span class="Constant">"; ZF="</span> << <a href='010---vm.cc.html#L83'>ZF</a> << <span class="Constant">"; CF="</span> << <a href='010---vm.cc.html#L84'>CF</a> << <span class="Constant">"; OF="</span> << <a href='010---vm.cc.html#L85'>OF</a> << end<span class="Delimiter">();</span> <span id="L40" class="LineNr"> 40 </span> *signed_arg1 = signed_result<span class="Delimiter">;</span> -<span id="L41" class="LineNr"> 41 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> +<span id="L41" class="LineNr"> 41 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> <span id="L42" class="LineNr"> 42 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L43" class="LineNr"> 43 </span><span class="Delimiter">}</span> <span id="L44" class="LineNr"> 44 </span> @@ -107,7 +107,7 @@ if ('onhashchange' in window) { <span id="L46" class="LineNr"> 46 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L46'>test_add_r32_to_r32_signed_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L47" class="LineNr"> 47 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x7fffffff</span><span class="Delimiter">;</span> <span class="Comment">// largest positive signed integer</span> <span id="L48" class="LineNr"> 48 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L49" class="LineNr"> 49 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L49" class="LineNr"> 49 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L50" class="LineNr"> 50 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L51" class="LineNr"> 51 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L52" class="LineNr"> 52 </span> <span class="Constant">" 01 d8 \n"</span> <span class="Comment">// add EBX to EAX</span> @@ -124,7 +124,7 @@ if ('onhashchange' in window) { <span id="L63" class="LineNr"> 63 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L63'>test_add_r32_to_r32_unsigned_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L64" class="LineNr"> 64 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u = <span class="Constant">0xffffffff</span><span class="Delimiter">;</span> <span class="Comment">// largest unsigned number</span> <span id="L65" class="LineNr"> 65 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>u = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L66" class="LineNr"> 66 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L66" class="LineNr"> 66 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L67" class="LineNr"> 67 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L68" class="LineNr"> 68 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L69" class="LineNr"> 69 </span> <span class="Constant">" 01 d8 \n"</span> <span class="Comment">// add EBX to EAX</span> @@ -140,7 +140,7 @@ if ('onhashchange' in window) { <span id="L79" class="LineNr"> 79 </span> <span id="L80" class="LineNr"> 80 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L80'>test_add_r32_to_r32_unsigned_and_signed_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L81" class="LineNr"> 81 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u = <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>u = <span class="Constant">0x80000000</span><span class="Delimiter">;</span> <span class="Comment">// smallest negative signed integer</span> -<span id="L82" class="LineNr"> 82 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L82" class="LineNr"> 82 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L83" class="LineNr"> 83 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L84" class="LineNr"> 84 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L85" class="LineNr"> 85 </span> <span class="Constant">" 01 d8 \n"</span> <span class="Comment">// add EBX to EAX</span> @@ -169,8 +169,8 @@ if ('onhashchange' in window) { <span id="L108" class="LineNr"> 108 </span> <span class="Identifier">return</span> &<span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[rm]<span class="Delimiter">.</span>i<span class="Delimiter">;</span> <span id="L109" class="LineNr"> 109 </span> <span class="Delimiter">}</span> <span id="L110" class="LineNr"> 110 </span> <span class="Normal">uint32_t</span> addr = <a href='013direct_addressing.cc.html#L116'>effective_address_number</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> -<span id="L111" class="LineNr"> 111 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"effective address contains "</span> << <a href='010---vm.cc.html#L190'>read_mem_i32</a><span class="Delimiter">(</span>addr<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> -<span id="L112" class="LineNr"> 112 </span> <span class="Identifier">return</span> <a href='010---vm.cc.html#L230'>mem_addr_i32</a><span class="Delimiter">(</span>addr<span class="Delimiter">);</span> +<span id="L111" class="LineNr"> 111 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"effective address contains "</span> << <a href='010---vm.cc.html#L179'>read_mem_i32</a><span class="Delimiter">(</span>addr<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> +<span id="L112" class="LineNr"> 112 </span> <span class="Identifier">return</span> <a href='010---vm.cc.html#L219'>mem_addr_i32</a><span class="Delimiter">(</span>addr<span class="Delimiter">);</span> <span id="L113" class="LineNr"> 113 </span><span class="Delimiter">}</span> <span id="L114" class="LineNr"> 114 </span> <span id="L115" class="LineNr"> 115 </span><span class="Comment">// beware: will eventually have side-effects</span> @@ -186,7 +186,7 @@ if ('onhashchange' in window) { <span id="L125" class="LineNr"> 125 </span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L126" class="LineNr"> 126 </span> <span class="Comment">// End Mod Special-cases(addr)</span> <span id="L127" class="LineNr"> 127 </span> <span class="Normal">default</span>: -<span id="L128" class="LineNr"> 128 </span> cerr << <span class="Constant">"unrecognized mod bits: "</span> << <a href='010---vm.cc.html#L411'>NUM</a><span class="Delimiter">(</span>mod<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L128" class="LineNr"> 128 </span> cerr << <span class="Constant">"unrecognized mod bits: "</span> << <a href='010---vm.cc.html#L400'>NUM</a><span class="Delimiter">(</span>mod<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L129" class="LineNr"> 129 </span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L130" class="LineNr"> 130 </span> <span class="Delimiter">}</span> <span id="L131" class="LineNr"> 131 </span> <span class="Comment">//: other mods are indirect, and they'll set addr appropriately</span> @@ -211,13 +211,13 @@ if ('onhashchange' in window) { <span id="L150" class="LineNr"> 150 </span><span class="SalientComment">//:: subtract</span> <span id="L151" class="LineNr"> 151 </span> <span id="L152" class="LineNr"> 152 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L153" class="LineNr"> 153 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"29"</span><span class="Delimiter">,</span> <span class="Constant">"subtract r32 from rm32 (sub)"</span><span class="Delimiter">);</span> +<span id="L153" class="LineNr"> 153 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"29"</span><span class="Delimiter">,</span> <span class="Constant">"subtract r32 from rm32 (sub)"</span><span class="Delimiter">);</span> <span id="L154" class="LineNr"> 154 </span> <span id="L155" class="LineNr"> 155 </span><span class="Delimiter">:(code)</span> <span id="L156" class="LineNr"> 156 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L156'>test_subtract_r32_from_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L157" class="LineNr"> 157 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">10</span><span class="Delimiter">;</span> <span id="L158" class="LineNr"> 158 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L159" class="LineNr"> 159 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L159" class="LineNr"> 159 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L160" class="LineNr"> 160 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L161" class="LineNr"> 161 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L162" class="LineNr"> 162 </span> <span class="Constant">" 29 d8 \n"</span> <span class="Comment">// subtract EBX from EAX</span> @@ -232,7 +232,7 @@ if ('onhashchange' in window) { <span id="L171" class="LineNr"> 171 </span> <span id="L172" class="LineNr"> 172 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L173" class="LineNr"> 173 </span><span class="Normal">case</span> <span class="Constant">0x29</span>: <span class="Delimiter">{</span> <span class="Comment">// subtract r32 from r/m32</span> -<span id="L174" class="LineNr"> 174 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L174" class="LineNr"> 174 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L175" class="LineNr"> 175 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> arg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L176" class="LineNr"> 176 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"subtract "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>arg2<span class="Delimiter">)</span> << <span class="Constant">" from r/m32"</span> << end<span class="Delimiter">();</span> <span id="L177" class="LineNr"> 177 </span> <span class="Normal">int32_t</span>* signed_arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> @@ -248,7 +248,7 @@ if ('onhashchange' in window) { <span id="L187" class="LineNr"> 187 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Delimiter">(</span>unsigned_result != unsigned_full_result<span class="Delimiter">);</span> <span id="L188" class="LineNr"> 188 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"SF="</span> << SF << <span class="Constant">"; ZF="</span> << <a href='010---vm.cc.html#L83'>ZF</a> << <span class="Constant">"; CF="</span> << <a href='010---vm.cc.html#L84'>CF</a> << <span class="Constant">"; OF="</span> << <a href='010---vm.cc.html#L85'>OF</a> << end<span class="Delimiter">();</span> <span id="L189" class="LineNr"> 189 </span> *signed_arg1 = signed_result<span class="Delimiter">;</span> -<span id="L190" class="LineNr"> 190 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> +<span id="L190" class="LineNr"> 190 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> <span id="L191" class="LineNr"> 191 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L192" class="LineNr"> 192 </span><span class="Delimiter">}</span> <span id="L193" class="LineNr"> 193 </span> @@ -256,7 +256,7 @@ if ('onhashchange' in window) { <span id="L195" class="LineNr"> 195 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L195'>test_subtract_r32_from_r32_signed_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L196" class="LineNr"> 196 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x80000000</span><span class="Delimiter">;</span> <span class="Comment">// smallest negative signed integer</span> <span id="L197" class="LineNr"> 197 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x7fffffff</span><span class="Delimiter">;</span> <span class="Comment">// largest positive signed integer</span> -<span id="L198" class="LineNr"> 198 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L198" class="LineNr"> 198 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L199" class="LineNr"> 199 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L200" class="LineNr"> 200 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L201" class="LineNr"> 201 </span> <span class="Constant">" 29 d8 \n"</span> <span class="Comment">// subtract EBX from EAX</span> @@ -273,7 +273,7 @@ if ('onhashchange' in window) { <span id="L212" class="LineNr"> 212 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L212'>test_subtract_r32_from_r32_unsigned_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L213" class="LineNr"> 213 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L214" class="LineNr"> 214 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L215" class="LineNr"> 215 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L215" class="LineNr"> 215 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L216" class="LineNr"> 216 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L217" class="LineNr"> 217 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L218" class="LineNr"> 218 </span> <span class="Constant">" 29 d8 \n"</span> <span class="Comment">// subtract EBX from EAX</span> @@ -290,7 +290,7 @@ if ('onhashchange' in window) { <span id="L229" class="LineNr"> 229 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L229'>test_subtract_r32_from_r32_signed_and_unsigned_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L230" class="LineNr"> 230 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L231" class="LineNr"> 231 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x80000000</span><span class="Delimiter">;</span> <span class="Comment">// smallest negative signed integer</span> -<span id="L232" class="LineNr"> 232 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L232" class="LineNr"> 232 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L233" class="LineNr"> 233 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L234" class="LineNr"> 234 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L235" class="LineNr"> 235 </span> <span class="Constant">" 29 d8 \n"</span> <span class="Comment">// subtract EBX from EAX</span> @@ -307,13 +307,13 @@ if ('onhashchange' in window) { <span id="L246" class="LineNr"> 246 </span><span class="SalientComment">//:: multiply</span> <span id="L247" class="LineNr"> 247 </span> <span id="L248" class="LineNr"> 248 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L249" class="LineNr"> 249 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"f7"</span><span class="Delimiter">,</span> <span class="Constant">"negate/multiply/divide rm32 (with <a href='010---vm.cc.html#L13'>EAX</a> and <a href='010---vm.cc.html#L15'>EDX</a> if necessary) depending on subop (neg/mul/idiv)"</span><span class="Delimiter">);</span> +<span id="L249" class="LineNr"> 249 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"f7"</span><span class="Delimiter">,</span> <span class="Constant">"negate/multiply/divide rm32 (with <a href='010---vm.cc.html#L13'>EAX</a> and <a href='010---vm.cc.html#L15'>EDX</a> if necessary) depending on subop (neg/mul/idiv)"</span><span class="Delimiter">);</span> <span id="L250" class="LineNr"> 250 </span> <span id="L251" class="LineNr"> 251 </span><span class="Delimiter">:(code)</span> <span id="L252" class="LineNr"> 252 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L252'>test_multiply_EAX_by_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L253" class="LineNr"> 253 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">4</span><span class="Delimiter">;</span> <span id="L254" class="LineNr"> 254 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">3</span><span class="Delimiter">;</span> -<span id="L255" class="LineNr"> 255 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L255" class="LineNr"> 255 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L256" class="LineNr"> 256 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L257" class="LineNr"> 257 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L258" class="LineNr"> 258 </span> <span class="Constant">" f7 e1 \n"</span> <span class="Comment">// multiply EAX by ECX</span> @@ -329,7 +329,7 @@ if ('onhashchange' in window) { <span id="L268" class="LineNr"> 268 </span> <span id="L269" class="LineNr"> 269 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L270" class="LineNr"> 270 </span><span class="Normal">case</span> <span class="Constant">0xf7</span>: <span class="Delimiter">{</span> -<span id="L271" class="LineNr"> 271 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L271" class="LineNr"> 271 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L272" class="LineNr"> 272 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"operate on r/m32"</span> << end<span class="Delimiter">();</span> <span id="L273" class="LineNr"> 273 </span> <span class="Normal">int32_t</span>* arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L274" class="LineNr"> 274 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> subop = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span class="Comment">// middle 3 'reg opcode' bits</span> @@ -342,12 +342,12 @@ if ('onhashchange' in window) { <span id="L281" class="LineNr"> 281 </span> <a href='010---vm.cc.html#L85'>OF</a> = <span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>u != <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L282" class="LineNr"> 282 </span> <a href='010---vm.cc.html#L84'>CF</a> = <a href='010---vm.cc.html#L85'>OF</a><span class="Delimiter">;</span> <span id="L283" class="LineNr"> 283 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"SF="</span> << SF << <span class="Constant">"; ZF="</span> << <a href='010---vm.cc.html#L83'>ZF</a> << <span class="Constant">"; CF="</span> << <a href='010---vm.cc.html#L84'>CF</a> << <span class="Constant">"; OF="</span> << <a href='010---vm.cc.html#L85'>OF</a> << end<span class="Delimiter">();</span> -<span id="L284" class="LineNr"> 284 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> +<span id="L284" class="LineNr"> 284 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> <span id="L285" class="LineNr"> 285 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L286" class="LineNr"> 286 </span> <span class="Delimiter">}</span> <span id="L287" class="LineNr"> 287 </span> <span class="Comment">// End Op f7 Subops</span> <span id="L288" class="LineNr"> 288 </span> <span class="Normal">default</span>: -<span id="L289" class="LineNr"> 289 </span> cerr << <span class="Constant">"unrecognized subop for opcode f7: "</span> << <a href='010---vm.cc.html#L411'>NUM</a><span class="Delimiter">(</span>subop<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L289" class="LineNr"> 289 </span> cerr << <span class="Constant">"unrecognized subop for opcode f7: "</span> << <a href='010---vm.cc.html#L400'>NUM</a><span class="Delimiter">(</span>subop<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L290" class="LineNr"> 290 </span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L291" class="LineNr"> 291 </span> <span class="Delimiter">}</span> <span id="L292" class="LineNr"> 292 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -356,13 +356,13 @@ if ('onhashchange' in window) { <span id="L295" class="LineNr"> 295 </span><span class="Comment">//:</span> <span id="L296" class="LineNr"> 296 </span> <span id="L297" class="LineNr"> 297 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L298" class="LineNr"> 298 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L357'>Name_0f</a></span><span class="Delimiter">,</span> <span class="Constant">"af"</span><span class="Delimiter">,</span> <span class="Constant">"multiply rm32 into r32 (imul)"</span><span class="Delimiter">);</span> +<span id="L298" class="LineNr"> 298 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L346'>Name_0f</a></span><span class="Delimiter">,</span> <span class="Constant">"af"</span><span class="Delimiter">,</span> <span class="Constant">"multiply rm32 into r32 (imul)"</span><span class="Delimiter">);</span> <span id="L299" class="LineNr"> 299 </span> <span id="L300" class="LineNr"> 300 </span><span class="Delimiter">:(code)</span> <span id="L301" class="LineNr"> 301 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L301'>test_multiply_r32_into_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L302" class="LineNr"> 302 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">4</span><span class="Delimiter">;</span> <span id="L303" class="LineNr"> 303 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">2</span><span class="Delimiter">;</span> -<span id="L304" class="LineNr"> 304 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L304" class="LineNr"> 304 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L305" class="LineNr"> 305 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L306" class="LineNr"> 306 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L307" class="LineNr"> 307 </span> <span class="Constant">" 0f af d8 \n"</span> <span class="Comment">// subtract EBX into EAX</span> @@ -377,7 +377,7 @@ if ('onhashchange' in window) { <span id="L316" class="LineNr"> 316 </span> <span id="L317" class="LineNr"> 317 </span><span class="Delimiter">:(before "End Two-Byte Opcodes Starting With 0f")</span> <span id="L318" class="LineNr"> 318 </span><span class="Normal">case</span> <span class="Constant">0xaf</span>: <span class="Delimiter">{</span> <span class="Comment">// multiply r32 by r/m32</span> -<span id="L319" class="LineNr"> 319 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L319" class="LineNr"> 319 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L320" class="LineNr"> 320 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> arg1 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L321" class="LineNr"> 321 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"multiply "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>arg1<span class="Delimiter">)</span> << <span class="Constant">" by r/m32"</span> << end<span class="Delimiter">();</span> <span id="L322" class="LineNr"> 322 </span> <span class="Normal">const</span> <span class="Normal">int32_t</span>* arg2 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> @@ -389,7 +389,7 @@ if ('onhashchange' in window) { <span id="L328" class="LineNr"> 328 </span> <a href='010---vm.cc.html#L84'>CF</a> = <a href='010---vm.cc.html#L85'>OF</a><span class="Delimiter">;</span> <span id="L329" class="LineNr"> 329 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"SF="</span> << SF << <span class="Constant">"; ZF="</span> << <a href='010---vm.cc.html#L83'>ZF</a> << <span class="Constant">"; CF="</span> << <a href='010---vm.cc.html#L84'>CF</a> << <span class="Constant">"; OF="</span> << <a href='010---vm.cc.html#L85'>OF</a> << end<span class="Delimiter">();</span> <span id="L330" class="LineNr"> 330 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[arg1]<span class="Delimiter">.</span>i = result<span class="Delimiter">;</span> -<span id="L331" class="LineNr"> 331 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[arg1]<span class="Delimiter">.</span>i << end<span class="Delimiter">();</span> +<span id="L331" class="LineNr"> 331 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[arg1]<span class="Delimiter">.</span>i << end<span class="Delimiter">();</span> <span id="L332" class="LineNr"> 332 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L333" class="LineNr"> 333 </span><span class="Delimiter">}</span> <span id="L334" class="LineNr"> 334 </span> @@ -398,7 +398,7 @@ if ('onhashchange' in window) { <span id="L337" class="LineNr"> 337 </span><span class="Delimiter">:(code)</span> <span id="L338" class="LineNr"> 338 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L338'>test_negate_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L339" class="LineNr"> 339 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L340" class="LineNr"> 340 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L340" class="LineNr"> 340 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L341" class="LineNr"> 341 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L342" class="LineNr"> 342 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L343" class="LineNr"> 343 </span> <span class="Constant">" f7 db \n"</span> <span class="Comment">// negate EBX</span> @@ -430,7 +430,7 @@ if ('onhashchange' in window) { <span id="L369" class="LineNr"> 369 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Delimiter">(</span>*arg1 != <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L370" class="LineNr"> 370 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"SF="</span> << SF << <span class="Constant">"; ZF="</span> << <a href='010---vm.cc.html#L83'>ZF</a> << <span class="Constant">"; CF="</span> << <a href='010---vm.cc.html#L84'>CF</a> << <span class="Constant">"; OF="</span> << <a href='010---vm.cc.html#L85'>OF</a> << end<span class="Delimiter">();</span> <span id="L371" class="LineNr"> 371 </span> *arg1 = result<span class="Delimiter">;</span> -<span id="L372" class="LineNr"> 372 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> +<span id="L372" class="LineNr"> 372 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> <span id="L373" class="LineNr"> 373 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L374" class="LineNr"> 374 </span><span class="Delimiter">}</span> <span id="L375" class="LineNr"> 375 </span> @@ -438,7 +438,7 @@ if ('onhashchange' in window) { <span id="L377" class="LineNr"> 377 </span><span class="Comment">// negate can overflow in exactly one situation</span> <span id="L378" class="LineNr"> 378 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L378'>test_negate_can_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L379" class="LineNr"> 379 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x80000000</span><span class="Delimiter">;</span> <span class="Comment">// INT_MIN</span> -<span id="L380" class="LineNr"> 380 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L380" class="LineNr"> 380 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L381" class="LineNr"> 381 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L382" class="LineNr"> 382 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L383" class="LineNr"> 383 </span> <span class="Constant">" f7 db \n"</span> <span class="Comment">// negate EBX</span> @@ -458,7 +458,7 @@ if ('onhashchange' in window) { <span id="L397" class="LineNr"> 397 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u = <span class="Constant">7</span><span class="Delimiter">;</span> <span id="L398" class="LineNr"> 398 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>u = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L399" class="LineNr"> 399 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">3</span><span class="Delimiter">;</span> -<span id="L400" class="LineNr"> 400 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L400" class="LineNr"> 400 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L401" class="LineNr"> 401 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L402" class="LineNr"> 402 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L403" class="LineNr"> 403 </span> <span class="Constant">" f7 f9 \n"</span> <span class="Comment">// multiply EAX by ECX</span> @@ -482,8 +482,8 @@ if ('onhashchange' in window) { <span id="L421" class="LineNr"> 421 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = dividend/divisor<span class="Delimiter">;</span> <span class="Comment">// quotient</span> <span id="L422" class="LineNr"> 422 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>i = dividend%divisor<span class="Delimiter">;</span> <span class="Comment">// remainder</span> <span id="L423" class="LineNr"> 423 </span> <span class="Comment">// flag state undefined</span> -<span id="L424" class="LineNr"> 424 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"quotient: 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i << end<span class="Delimiter">();</span> -<span id="L425" class="LineNr"> 425 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"remainder: 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>i << end<span class="Delimiter">();</span> +<span id="L424" class="LineNr"> 424 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"quotient: 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i << end<span class="Delimiter">();</span> +<span id="L425" class="LineNr"> 425 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"remainder: 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>i << end<span class="Delimiter">();</span> <span id="L426" class="LineNr"> 426 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L427" class="LineNr"> 427 </span><span class="Delimiter">}</span> <span id="L428" class="LineNr"> 428 </span> @@ -492,7 +492,7 @@ if ('onhashchange' in window) { <span id="L431" class="LineNr"> 431 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u = <span class="Constant">7</span><span class="Delimiter">;</span> <span id="L432" class="LineNr"> 432 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>u = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L433" class="LineNr"> 433 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = -<span class="Constant">3</span><span class="Delimiter">;</span> -<span id="L434" class="LineNr"> 434 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L434" class="LineNr"> 434 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L435" class="LineNr"> 435 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L436" class="LineNr"> 436 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L437" class="LineNr"> 437 </span> <span class="Constant">" f7 f9 \n"</span> <span class="Comment">// multiply EAX by ECX</span> @@ -511,7 +511,7 @@ if ('onhashchange' in window) { <span id="L450" class="LineNr"> 450 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = -<span class="Constant">7</span><span class="Delimiter">;</span> <span id="L451" class="LineNr"> 451 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>i = -<span class="Constant">1</span><span class="Delimiter">;</span> <span class="Comment">// sign extend</span> <span id="L452" class="LineNr"> 452 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">3</span><span class="Delimiter">;</span> -<span id="L453" class="LineNr"> 453 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L453" class="LineNr"> 453 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L454" class="LineNr"> 454 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L455" class="LineNr"> 455 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L456" class="LineNr"> 456 </span> <span class="Constant">" f7 f9 \n"</span> <span class="Comment">// multiply EAX by ECX</span> @@ -530,7 +530,7 @@ if ('onhashchange' in window) { <span id="L469" class="LineNr"> 469 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0</span><span class="Delimiter">;</span> <span class="Comment">// lower 32 bits are clear</span> <span id="L470" class="LineNr"> 470 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EDX]<span class="Delimiter">.</span>i = -<span class="Constant">7</span><span class="Delimiter">;</span> <span id="L471" class="LineNr"> 471 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">0x40000000</span><span class="Delimiter">;</span> <span class="Comment">// 2^30 (largest positive power of 2)</span> -<span id="L472" class="LineNr"> 472 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L472" class="LineNr"> 472 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L473" class="LineNr"> 473 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L474" class="LineNr"> 474 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L475" class="LineNr"> 475 </span> <span class="Constant">" f7 f9 \n"</span> <span class="Comment">// multiply EAX by ECX</span> @@ -548,13 +548,13 @@ if ('onhashchange' in window) { <span id="L487" class="LineNr"> 487 </span><span class="SalientComment">//:: shift left</span> <span id="L488" class="LineNr"> 488 </span> <span id="L489" class="LineNr"> 489 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L490" class="LineNr"> 490 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"d3"</span><span class="Delimiter">,</span> <span class="Constant">"shift rm32 by CL bits depending on subop (sal/sar/shl/shr)"</span><span class="Delimiter">);</span> +<span id="L490" class="LineNr"> 490 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"d3"</span><span class="Delimiter">,</span> <span class="Constant">"shift rm32 by CL bits depending on subop (sal/sar/shl/shr)"</span><span class="Delimiter">);</span> <span id="L491" class="LineNr"> 491 </span> <span id="L492" class="LineNr"> 492 </span><span class="Delimiter">:(code)</span> <span id="L493" class="LineNr"> 493 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L493'>test_shift_left_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L494" class="LineNr"> 494 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">13</span><span class="Delimiter">;</span> <span id="L495" class="LineNr"> 495 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L496" class="LineNr"> 496 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L496" class="LineNr"> 496 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L497" class="LineNr"> 497 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L498" class="LineNr"> 498 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L499" class="LineNr"> 499 </span> <span class="Constant">" d3 e3 \n"</span> <span class="Comment">// shift EBX left by CL bits</span> @@ -570,7 +570,7 @@ if ('onhashchange' in window) { <span id="L509" class="LineNr"> 509 </span> <span id="L510" class="LineNr"> 510 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L511" class="LineNr"> 511 </span><span class="Normal">case</span> <span class="Constant">0xd3</span>: <span class="Delimiter">{</span> -<span id="L512" class="LineNr"> 512 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L512" class="LineNr"> 512 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L513" class="LineNr"> 513 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"operate on r/m32"</span> << end<span class="Delimiter">();</span> <span id="L514" class="LineNr"> 514 </span> <span class="Normal">int32_t</span>* arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L515" class="LineNr"> 515 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> subop = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span class="Comment">// middle 3 'reg opcode' bits</span> @@ -590,12 +590,12 @@ if ('onhashchange' in window) { <span id="L529" class="LineNr"> 529 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Delimiter">(</span>*arg1 << <span class="Delimiter">(</span>count-<span class="Constant">1</span><span class="Delimiter">))</span> & <span class="Constant">0x80000000</span><span class="Delimiter">;</span> <span id="L530" class="LineNr"> 530 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"SF="</span> << SF << <span class="Constant">"; ZF="</span> << <a href='010---vm.cc.html#L83'>ZF</a> << <span class="Constant">"; CF="</span> << <a href='010---vm.cc.html#L84'>CF</a> << <span class="Constant">"; OF="</span> << <a href='010---vm.cc.html#L85'>OF</a> << end<span class="Delimiter">();</span> <span id="L531" class="LineNr"> 531 </span> *arg1 = result<span class="Delimiter">;</span> -<span id="L532" class="LineNr"> 532 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> +<span id="L532" class="LineNr"> 532 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> <span id="L533" class="LineNr"> 533 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L534" class="LineNr"> 534 </span> <span class="Delimiter">}</span> <span id="L535" class="LineNr"> 535 </span> <span class="Comment">// End Op d3 Subops</span> <span id="L536" class="LineNr"> 536 </span> <span class="Normal">default</span>: -<span id="L537" class="LineNr"> 537 </span> cerr << <span class="Constant">"unrecognized subop for opcode d3: "</span> << <a href='010---vm.cc.html#L411'>NUM</a><span class="Delimiter">(</span>subop<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L537" class="LineNr"> 537 </span> cerr << <span class="Constant">"unrecognized subop for opcode d3: "</span> << <a href='010---vm.cc.html#L400'>NUM</a><span class="Delimiter">(</span>subop<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L538" class="LineNr"> 538 </span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L539" class="LineNr"> 539 </span> <span class="Delimiter">}</span> <span id="L540" class="LineNr"> 540 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -607,7 +607,7 @@ if ('onhashchange' in window) { <span id="L546" class="LineNr"> 546 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L546'>test_shift_right_arithmetic_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L547" class="LineNr"> 547 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">26</span><span class="Delimiter">;</span> <span id="L548" class="LineNr"> 548 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L549" class="LineNr"> 549 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L549" class="LineNr"> 549 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L550" class="LineNr"> 550 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L551" class="LineNr"> 551 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L552" class="LineNr"> 552 </span> <span class="Constant">" d3 fb \n"</span> <span class="Comment">// shift EBX right by CL bits, while preserving sign</span> @@ -631,7 +631,7 @@ if ('onhashchange' in window) { <span id="L570" class="LineNr"> 570 </span> <span class="Comment">// OF is only defined if count is 1</span> <span id="L571" class="LineNr"> 571 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>count == <span class="Constant">1</span><span class="Delimiter">)</span> <a href='010---vm.cc.html#L85'>OF</a> = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L572" class="LineNr"> 572 </span> <span class="Comment">// CF undefined</span> -<span id="L573" class="LineNr"> 573 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> +<span id="L573" class="LineNr"> 573 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> <span id="L574" class="LineNr"> 574 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L575" class="LineNr"> 575 </span><span class="Delimiter">}</span> <span id="L576" class="LineNr"> 576 </span> @@ -639,7 +639,7 @@ if ('onhashchange' in window) { <span id="L578" class="LineNr"> 578 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L578'>test_shift_right_arithmetic_odd_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L579" class="LineNr"> 579 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">27</span><span class="Delimiter">;</span> <span id="L580" class="LineNr"> 580 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L581" class="LineNr"> 581 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L581" class="LineNr"> 581 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L582" class="LineNr"> 582 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L583" class="LineNr"> 583 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L584" class="LineNr"> 584 </span> <span class="Constant">" d3 fb \n"</span> <span class="Comment">// shift EBX right by CL bits, while preserving sign</span> @@ -657,7 +657,7 @@ if ('onhashchange' in window) { <span id="L596" class="LineNr"> 596 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L596'>test_shift_right_arithmetic_negative_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L597" class="LineNr"> 597 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xfffffffd</span><span class="Delimiter">;</span> <span class="Comment">// -3</span> <span id="L598" class="LineNr"> 598 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L599" class="LineNr"> 599 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L599" class="LineNr"> 599 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L600" class="LineNr"> 600 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L601" class="LineNr"> 601 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L602" class="LineNr"> 602 </span> <span class="Constant">" d3 fb \n"</span> <span class="Comment">// shift EBX right by CL bits, while preserving sign</span> @@ -678,7 +678,7 @@ if ('onhashchange' in window) { <span id="L617" class="LineNr"> 617 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L617'>test_shift_right_logical_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L618" class="LineNr"> 618 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">26</span><span class="Delimiter">;</span> <span id="L619" class="LineNr"> 619 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L620" class="LineNr"> 620 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L620" class="LineNr"> 620 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L621" class="LineNr"> 621 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L622" class="LineNr"> 622 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L623" class="LineNr"> 623 </span> <span class="Constant">" d3 eb \n"</span> <span class="Comment">// shift EBX right by CL bits, while padding zeroes</span> @@ -709,7 +709,7 @@ if ('onhashchange' in window) { <span id="L648" class="LineNr"> 648 </span> <span class="Comment">// result is always positive by definition</span> <span id="L649" class="LineNr"> 649 </span> SF = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L650" class="LineNr"> 650 </span> <span class="Comment">// CF undefined</span> -<span id="L651" class="LineNr"> 651 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> +<span id="L651" class="LineNr"> 651 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> <span id="L652" class="LineNr"> 652 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L653" class="LineNr"> 653 </span><span class="Delimiter">}</span> <span id="L654" class="LineNr"> 654 </span> @@ -717,7 +717,7 @@ if ('onhashchange' in window) { <span id="L656" class="LineNr"> 656 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L656'>test_shift_right_logical_odd_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L657" class="LineNr"> 657 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">27</span><span class="Delimiter">;</span> <span id="L658" class="LineNr"> 658 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L659" class="LineNr"> 659 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L659" class="LineNr"> 659 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L660" class="LineNr"> 660 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L661" class="LineNr"> 661 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L662" class="LineNr"> 662 </span> <span class="Constant">" d3 eb \n"</span> <span class="Comment">// shift EBX right by CL bits, while padding zeroes</span> @@ -735,7 +735,7 @@ if ('onhashchange' in window) { <span id="L674" class="LineNr"> 674 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L674'>test_shift_right_logical_negative_r32_with_cl</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L675" class="LineNr"> 675 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xfffffffd</span><span class="Delimiter">;</span> <span id="L676" class="LineNr"> 676 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>i = <span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L677" class="LineNr"> 677 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L677" class="LineNr"> 677 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L678" class="LineNr"> 678 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L679" class="LineNr"> 679 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L680" class="LineNr"> 680 </span> <span class="Constant">" d3 eb \n"</span> <span class="Comment">// shift EBX right by CL bits, while padding zeroes</span> @@ -752,13 +752,13 @@ if ('onhashchange' in window) { <span id="L691" class="LineNr"> 691 </span><span class="SalientComment">//:: and</span> <span id="L692" class="LineNr"> 692 </span> <span id="L693" class="LineNr"> 693 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L694" class="LineNr"> 694 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"21"</span><span class="Delimiter">,</span> <span class="Constant">"rm32 = bitwise AND of r32 with rm32 (and)"</span><span class="Delimiter">);</span> +<span id="L694" class="LineNr"> 694 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"21"</span><span class="Delimiter">,</span> <span class="Constant">"rm32 = bitwise AND of r32 with rm32 (and)"</span><span class="Delimiter">);</span> <span id="L695" class="LineNr"> 695 </span> <span id="L696" class="LineNr"> 696 </span><span class="Delimiter">:(code)</span> <span id="L697" class="LineNr"> 697 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L697'>test_and_r32_with_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L698" class="LineNr"> 698 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> <span id="L699" class="LineNr"> 699 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x000000ff</span><span class="Delimiter">;</span> -<span id="L700" class="LineNr"> 700 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L700" class="LineNr"> 700 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L701" class="LineNr"> 701 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L702" class="LineNr"> 702 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L703" class="LineNr"> 703 </span> <span class="Constant">" 21 d8 \n"</span> <span class="Comment">// and EBX with destination EAX</span> @@ -773,14 +773,14 @@ if ('onhashchange' in window) { <span id="L712" class="LineNr"> 712 </span> <span id="L713" class="LineNr"> 713 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L714" class="LineNr"> 714 </span><span class="Normal">case</span> <span class="Constant">0x21</span>: <span class="Delimiter">{</span> <span class="Comment">// and r32 with r/m32</span> -<span id="L715" class="LineNr"> 715 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L715" class="LineNr"> 715 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L716" class="LineNr"> 716 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> arg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L717" class="LineNr"> 717 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"and "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>arg2<span class="Delimiter">)</span> << <span class="Constant">" with r/m32"</span> << end<span class="Delimiter">();</span> <span id="L718" class="LineNr"> 718 </span> <span class="Comment">// bitwise ops technically operate on unsigned numbers, but it makes no</span> <span id="L719" class="LineNr"> 719 </span> <span class="Comment">// difference</span> <span id="L720" class="LineNr"> 720 </span> <span class="Normal">int32_t</span>* signed_arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L721" class="LineNr"> 721 </span> *signed_arg1 &= <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[arg2]<span class="Delimiter">.</span>i<span class="Delimiter">;</span> -<span id="L722" class="LineNr"> 722 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> +<span id="L722" class="LineNr"> 722 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> <span id="L723" class="LineNr"> 723 </span> SF = <span class="Delimiter">(</span>*signed_arg1 >> <span class="Constant">31</span><span class="Delimiter">);</span> <span id="L724" class="LineNr"> 724 </span> <a href='010---vm.cc.html#L83'>ZF</a> = <span class="Delimiter">(</span>*signed_arg1 == <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L725" class="LineNr"> 725 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Constant">false</span><span class="Delimiter">;</span> @@ -792,13 +792,13 @@ if ('onhashchange' in window) { <span id="L731" class="LineNr"> 731 </span><span class="SalientComment">//:: or</span> <span id="L732" class="LineNr"> 732 </span> <span id="L733" class="LineNr"> 733 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L734" class="LineNr"> 734 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"09"</span><span class="Delimiter">,</span> <span class="Constant">"rm32 = bitwise OR of r32 with rm32 (or)"</span><span class="Delimiter">);</span> +<span id="L734" class="LineNr"> 734 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"09"</span><span class="Delimiter">,</span> <span class="Constant">"rm32 = bitwise OR of r32 with rm32 (or)"</span><span class="Delimiter">);</span> <span id="L735" class="LineNr"> 735 </span> <span id="L736" class="LineNr"> 736 </span><span class="Delimiter">:(code)</span> <span id="L737" class="LineNr"> 737 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L737'>test_or_r32_with_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L738" class="LineNr"> 738 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> <span id="L739" class="LineNr"> 739 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xa0b0c0d0</span><span class="Delimiter">;</span> -<span id="L740" class="LineNr"> 740 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L740" class="LineNr"> 740 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L741" class="LineNr"> 741 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L742" class="LineNr"> 742 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L743" class="LineNr"> 743 </span> <span class="Constant">" 09 d8 \n"</span> <span class="Comment">// or EBX with destination EAX</span> @@ -813,14 +813,14 @@ if ('onhashchange' in window) { <span id="L752" class="LineNr"> 752 </span> <span id="L753" class="LineNr"> 753 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L754" class="LineNr"> 754 </span><span class="Normal">case</span> <span class="Constant">0x09</span>: <span class="Delimiter">{</span> <span class="Comment">// or r32 with r/m32</span> -<span id="L755" class="LineNr"> 755 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L755" class="LineNr"> 755 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L756" class="LineNr"> 756 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> arg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L757" class="LineNr"> 757 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"or "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>arg2<span class="Delimiter">)</span> << <span class="Constant">" with r/m32"</span> << end<span class="Delimiter">();</span> <span id="L758" class="LineNr"> 758 </span> <span class="Comment">// bitwise ops technically operate on unsigned numbers, but it makes no</span> <span id="L759" class="LineNr"> 759 </span> <span class="Comment">// difference</span> <span id="L760" class="LineNr"> 760 </span> <span class="Normal">int32_t</span>* signed_arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L761" class="LineNr"> 761 </span> *signed_arg1 |= <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[arg2]<span class="Delimiter">.</span>i<span class="Delimiter">;</span> -<span id="L762" class="LineNr"> 762 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> +<span id="L762" class="LineNr"> 762 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> <span id="L763" class="LineNr"> 763 </span> SF = <span class="Delimiter">(</span>*signed_arg1 >> <span class="Constant">31</span><span class="Delimiter">);</span> <span id="L764" class="LineNr"> 764 </span> <a href='010---vm.cc.html#L83'>ZF</a> = <span class="Delimiter">(</span>*signed_arg1 == <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L765" class="LineNr"> 765 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Constant">false</span><span class="Delimiter">;</span> @@ -832,13 +832,13 @@ if ('onhashchange' in window) { <span id="L771" class="LineNr"> 771 </span><span class="SalientComment">//:: xor</span> <span id="L772" class="LineNr"> 772 </span> <span id="L773" class="LineNr"> 773 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L774" class="LineNr"> 774 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"31"</span><span class="Delimiter">,</span> <span class="Constant">"rm32 = bitwise XOR of r32 with rm32 (xor)"</span><span class="Delimiter">);</span> +<span id="L774" class="LineNr"> 774 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"31"</span><span class="Delimiter">,</span> <span class="Constant">"rm32 = bitwise XOR of r32 with rm32 (xor)"</span><span class="Delimiter">);</span> <span id="L775" class="LineNr"> 775 </span> <span id="L776" class="LineNr"> 776 </span><span class="Delimiter">:(code)</span> <span id="L777" class="LineNr"> 777 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L777'>test_xor_r32_with_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L778" class="LineNr"> 778 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> <span id="L779" class="LineNr"> 779 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xaabbc0d0</span><span class="Delimiter">;</span> -<span id="L780" class="LineNr"> 780 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L780" class="LineNr"> 780 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L781" class="LineNr"> 781 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L782" class="LineNr"> 782 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L783" class="LineNr"> 783 </span> <span class="Constant">" 31 d8 \n"</span> <span class="Comment">// xor EBX with destination EAX</span> @@ -853,14 +853,14 @@ if ('onhashchange' in window) { <span id="L792" class="LineNr"> 792 </span> <span id="L793" class="LineNr"> 793 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L794" class="LineNr"> 794 </span><span class="Normal">case</span> <span class="Constant">0x31</span>: <span class="Delimiter">{</span> <span class="Comment">// xor r32 with r/m32</span> -<span id="L795" class="LineNr"> 795 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L795" class="LineNr"> 795 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L796" class="LineNr"> 796 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> arg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L797" class="LineNr"> 797 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"xor "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>arg2<span class="Delimiter">)</span> << <span class="Constant">" with r/m32"</span> << end<span class="Delimiter">();</span> <span id="L798" class="LineNr"> 798 </span> <span class="Comment">// bitwise ops technically operate on unsigned numbers, but it makes no</span> <span id="L799" class="LineNr"> 799 </span> <span class="Comment">// difference</span> <span id="L800" class="LineNr"> 800 </span> <span class="Normal">int32_t</span>* signed_arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L801" class="LineNr"> 801 </span> *signed_arg1 ^= <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[arg2]<span class="Delimiter">.</span>i<span class="Delimiter">;</span> -<span id="L802" class="LineNr"> 802 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> +<span id="L802" class="LineNr"> 802 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *signed_arg1 << end<span class="Delimiter">();</span> <span id="L803" class="LineNr"> 803 </span> SF = <span class="Delimiter">(</span>*signed_arg1 >> <span class="Constant">31</span><span class="Delimiter">);</span> <span id="L804" class="LineNr"> 804 </span> <a href='010---vm.cc.html#L83'>ZF</a> = <span class="Delimiter">(</span>*signed_arg1 == <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L805" class="LineNr"> 805 </span> <a href='010---vm.cc.html#L84'>CF</a> = <span class="Constant">false</span><span class="Delimiter">;</span> @@ -874,7 +874,7 @@ if ('onhashchange' in window) { <span id="L813" class="LineNr"> 813 </span><span class="Delimiter">:(code)</span> <span id="L814" class="LineNr"> 814 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L814'>test_not_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L815" class="LineNr"> 815 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x0f0f00ff</span><span class="Delimiter">;</span> -<span id="L816" class="LineNr"> 816 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L816" class="LineNr"> 816 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L817" class="LineNr"> 817 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L818" class="LineNr"> 818 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L819" class="LineNr"> 819 </span> <span class="Constant">" f7 d3 \n"</span> <span class="Comment">// not EBX</span> @@ -892,7 +892,7 @@ if ('onhashchange' in window) { <span id="L831" class="LineNr"> 831 </span><span class="Normal">case</span> <span class="Constant">2</span>: <span class="Delimiter">{</span> <span class="Comment">// not r/m32</span> <span id="L832" class="LineNr"> 832 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"subop: not"</span> << end<span class="Delimiter">();</span> <span id="L833" class="LineNr"> 833 </span> *arg1 = ~<span class="Delimiter">(</span>*arg1<span class="Delimiter">);</span> -<span id="L834" class="LineNr"> 834 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> +<span id="L834" class="LineNr"> 834 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg1 << end<span class="Delimiter">();</span> <span id="L835" class="LineNr"> 835 </span> <span class="Comment">// no flags affected</span> <span id="L836" class="LineNr"> 836 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L837" class="LineNr"> 837 </span><span class="Delimiter">}</span> @@ -900,13 +900,13 @@ if ('onhashchange' in window) { <span id="L839" class="LineNr"> 839 </span><span class="SalientComment">//:: compare (cmp)</span> <span id="L840" class="LineNr"> 840 </span> <span id="L841" class="LineNr"> 841 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L842" class="LineNr"> 842 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"39"</span><span class="Delimiter">,</span> <span class="Constant">"compare: set SF if rm32 < r32 (cmp)"</span><span class="Delimiter">);</span> +<span id="L842" class="LineNr"> 842 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"39"</span><span class="Delimiter">,</span> <span class="Constant">"compare: set SF if rm32 < r32 (cmp)"</span><span class="Delimiter">);</span> <span id="L843" class="LineNr"> 843 </span> <span id="L844" class="LineNr"> 844 </span><span class="Delimiter">:(code)</span> <span id="L845" class="LineNr"> 845 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L845'>test_compare_r32_with_r32_greater</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L846" class="LineNr"> 846 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> <span id="L847" class="LineNr"> 847 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c07</span><span class="Delimiter">;</span> -<span id="L848" class="LineNr"> 848 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L848" class="LineNr"> 848 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L849" class="LineNr"> 849 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L850" class="LineNr"> 850 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L851" class="LineNr"> 851 </span> <span class="Constant">" 39 d8 \n"</span> <span class="Comment">// compare EAX with EBX</span> @@ -921,7 +921,7 @@ if ('onhashchange' in window) { <span id="L860" class="LineNr"> 860 </span> <span id="L861" class="LineNr"> 861 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L862" class="LineNr"> 862 </span><span class="Normal">case</span> <span class="Constant">0x39</span>: <span class="Delimiter">{</span> <span class="Comment">// set SF if r/m32 < r32</span> -<span id="L863" class="LineNr"> 863 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L863" class="LineNr"> 863 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L864" class="LineNr"> 864 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> reg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L865" class="LineNr"> 865 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"compare r/m32 with "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>reg2<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> <span id="L866" class="LineNr"> 866 </span> <span class="Normal">const</span> <span class="Normal">int32_t</span>* signed_arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> @@ -943,7 +943,7 @@ if ('onhashchange' in window) { <span id="L882" class="LineNr"> 882 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L882'>test_compare_r32_with_r32_lesser_unsigned_and_signed</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L883" class="LineNr"> 883 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c07</span><span class="Delimiter">;</span> <span id="L884" class="LineNr"> 884 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> -<span id="L885" class="LineNr"> 885 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L885" class="LineNr"> 885 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L886" class="LineNr"> 886 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L887" class="LineNr"> 887 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L888" class="LineNr"> 888 </span> <span class="Constant">" 39 d8 \n"</span> <span class="Comment">// compare EAX with EBX</span> @@ -959,7 +959,7 @@ if ('onhashchange' in window) { <span id="L898" class="LineNr"> 898 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L898'>test_compare_r32_with_r32_lesser_unsigned_and_signed_due_to_overflow</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L899" class="LineNr"> 899 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x7fffffff</span><span class="Delimiter">;</span> <span class="Comment">// largest positive signed integer</span> <span id="L900" class="LineNr"> 900 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x80000000</span><span class="Delimiter">;</span> <span class="Comment">// smallest negative signed integer</span> -<span id="L901" class="LineNr"> 901 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L901" class="LineNr"> 901 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L902" class="LineNr"> 902 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L903" class="LineNr"> 903 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L904" class="LineNr"> 904 </span> <span class="Constant">" 39 d8 \n"</span> <span class="Comment">// compare EAX with EBX</span> @@ -975,7 +975,7 @@ if ('onhashchange' in window) { <span id="L914" class="LineNr"> 914 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L914'>test_compare_r32_with_r32_lesser_signed</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L915" class="LineNr"> 915 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0xffffffff</span><span class="Delimiter">;</span> <span class="Comment">// -1</span> <span id="L916" class="LineNr"> 916 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x00000001</span><span class="Delimiter">;</span> <span class="Comment">// 1</span> -<span id="L917" class="LineNr"> 917 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L917" class="LineNr"> 917 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L918" class="LineNr"> 918 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L919" class="LineNr"> 919 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L920" class="LineNr"> 920 </span> <span class="Constant">" 39 d8 \n"</span> <span class="Comment">// compare EAX with EBX</span> @@ -991,7 +991,7 @@ if ('onhashchange' in window) { <span id="L930" class="LineNr"> 930 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L930'>test_compare_r32_with_r32_lesser_unsigned</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L931" class="LineNr"> 931 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x00000001</span><span class="Delimiter">;</span> <span class="Comment">// 1</span> <span id="L932" class="LineNr"> 932 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xffffffff</span><span class="Delimiter">;</span> <span class="Comment">// -1</span> -<span id="L933" class="LineNr"> 933 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L933" class="LineNr"> 933 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L934" class="LineNr"> 934 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L935" class="LineNr"> 935 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L936" class="LineNr"> 936 </span> <span class="Constant">" 39 d8 \n"</span> <span class="Comment">// compare EAX with EBX</span> @@ -1007,7 +1007,7 @@ if ('onhashchange' in window) { <span id="L946" class="LineNr"> 946 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L946'>test_compare_r32_with_r32_equal</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L947" class="LineNr"> 947 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> <span id="L948" class="LineNr"> 948 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x0a0b0c0d</span><span class="Delimiter">;</span> -<span id="L949" class="LineNr"> 949 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L949" class="LineNr"> 949 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L950" class="LineNr"> 950 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L951" class="LineNr"> 951 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L952" class="LineNr"> 952 </span> <span class="Constant">" 39 d8 \n"</span> <span class="Comment">// compare EAX and EBX</span> @@ -1023,12 +1023,12 @@ if ('onhashchange' in window) { <span id="L962" class="LineNr"> 962 </span><span class="SalientComment">//:: copy (mov)</span> <span id="L963" class="LineNr"> 963 </span> <span id="L964" class="LineNr"> 964 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L965" class="LineNr"> 965 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"89"</span><span class="Delimiter">,</span> <span class="Constant">"copy r32 to rm32 (mov)"</span><span class="Delimiter">);</span> +<span id="L965" class="LineNr"> 965 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"89"</span><span class="Delimiter">,</span> <span class="Constant">"copy r32 to rm32 (mov)"</span><span class="Delimiter">);</span> <span id="L966" class="LineNr"> 966 </span> <span id="L967" class="LineNr"> 967 </span><span class="Delimiter">:(code)</span> <span id="L968" class="LineNr"> 968 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L968'>test_copy_r32_to_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L969" class="LineNr"> 969 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xaf</span><span class="Delimiter">;</span> -<span id="L970" class="LineNr"> 970 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L970" class="LineNr"> 970 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L971" class="LineNr"> 971 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L972" class="LineNr"> 972 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L973" class="LineNr"> 973 </span> <span class="Constant">" 89 d8 \n"</span> <span class="Comment">// copy EBX to EAX</span> @@ -1043,25 +1043,25 @@ if ('onhashchange' in window) { <span id="L982" class="LineNr"> 982 </span> <span id="L983" class="LineNr"> 983 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L984" class="LineNr"> 984 </span><span class="Normal">case</span> <span class="Constant">0x89</span>: <span class="Delimiter">{</span> <span class="Comment">// copy r32 to r/m32</span> -<span id="L985" class="LineNr"> 985 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L985" class="LineNr"> 985 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L986" class="LineNr"> 986 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> rsrc = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L987" class="LineNr"> 987 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"copy "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>rsrc<span class="Delimiter">)</span> << <span class="Constant">" to r/m32"</span> << end<span class="Delimiter">();</span> <span id="L988" class="LineNr"> 988 </span> <span class="Normal">int32_t</span>* dest = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L989" class="LineNr"> 989 </span> *dest = <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[rsrc]<span class="Delimiter">.</span>i<span class="Delimiter">;</span> -<span id="L990" class="LineNr"> 990 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *dest << end<span class="Delimiter">();</span> +<span id="L990" class="LineNr"> 990 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *dest << end<span class="Delimiter">();</span> <span id="L991" class="LineNr"> 991 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L992" class="LineNr"> 992 </span><span class="Delimiter">}</span> <span id="L993" class="LineNr"> 993 </span> <span id="L994" class="LineNr"> 994 </span><span class="SalientComment">//:: xchg</span> <span id="L995" class="LineNr"> 995 </span> <span id="L996" class="LineNr"> 996 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L997" class="LineNr"> 997 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"87"</span><span class="Delimiter">,</span> <span class="Constant">"swap the <a href='003trace.cc.html#L117'>contents</a> of r32 and rm32 (xchg)"</span><span class="Delimiter">);</span> +<span id="L997" class="LineNr"> 997 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"87"</span><span class="Delimiter">,</span> <span class="Constant">"swap the <a href='003trace.cc.html#L117'>contents</a> of r32 and rm32 (xchg)"</span><span class="Delimiter">);</span> <span id="L998" class="LineNr"> 998 </span> <span id="L999" class="LineNr"> 999 </span><span class="Delimiter">:(code)</span> <span id="L1000" class="LineNr">1000 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1000'>test_xchg_r32_with_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1001" class="LineNr">1001 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0xaf</span><span class="Delimiter">;</span> <span id="L1002" class="LineNr">1002 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>i = <span class="Constant">0x2e</span><span class="Delimiter">;</span> -<span id="L1003" class="LineNr">1003 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1003" class="LineNr">1003 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1004" class="LineNr">1004 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1005" class="LineNr">1005 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1006" class="LineNr">1006 </span> <span class="Constant">" 87 d8 \n"</span> <span class="Comment">// exchange EBX with EAX</span> @@ -1077,34 +1077,34 @@ if ('onhashchange' in window) { <span id="L1016" class="LineNr">1016 </span> <span id="L1017" class="LineNr">1017 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L1018" class="LineNr">1018 </span><span class="Normal">case</span> <span class="Constant">0x87</span>: <span class="Delimiter">{</span> <span class="Comment">// exchange r32 with r/m32</span> -<span id="L1019" class="LineNr">1019 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L1019" class="LineNr">1019 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L1020" class="LineNr">1020 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> reg2 = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L1021" class="LineNr">1021 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"exchange "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>reg2<span class="Delimiter">)</span> << <span class="Constant">" with r/m32"</span> << end<span class="Delimiter">();</span> <span id="L1022" class="LineNr">1022 </span> <span class="Normal">int32_t</span>* arg1 = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L1023" class="LineNr">1023 </span> <span class="Normal">const</span> <span class="Normal">int32_t</span> tmp = *arg1<span class="Delimiter">;</span> <span id="L1024" class="LineNr">1024 </span> *arg1 = <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg2]<span class="Delimiter">.</span>i<span class="Delimiter">;</span> <span id="L1025" class="LineNr">1025 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg2]<span class="Delimiter">.</span>i = tmp<span class="Delimiter">;</span> -<span id="L1026" class="LineNr">1026 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg1 << <span class="Constant">" in r/m32"</span> << end<span class="Delimiter">();</span> -<span id="L1027" class="LineNr">1027 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg2]<span class="Delimiter">.</span>i << <span class="Constant">" in "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>reg2<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> +<span id="L1026" class="LineNr">1026 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg1 << <span class="Constant">" in r/m32"</span> << end<span class="Delimiter">();</span> +<span id="L1027" class="LineNr">1027 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg2]<span class="Delimiter">.</span>i << <span class="Constant">" in "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span>reg2<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> <span id="L1028" class="LineNr">1028 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L1029" class="LineNr">1029 </span><span class="Delimiter">}</span> <span id="L1030" class="LineNr">1030 </span> <span id="L1031" class="LineNr">1031 </span><span class="SalientComment">//:: increment</span> <span id="L1032" class="LineNr">1032 </span> <span id="L1033" class="LineNr">1033 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L1034" class="LineNr">1034 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"40"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L13'>EAX</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1035" class="LineNr">1035 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"41"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L14'>ECX</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1036" class="LineNr">1036 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"42"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L15'>EDX</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1037" class="LineNr">1037 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"43"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L16'>EBX</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1038" class="LineNr">1038 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"44"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L17'>ESP</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1039" class="LineNr">1039 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"45"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L18'>EBP</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1040" class="LineNr">1040 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"46"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L19'>ESI</a> (inc)"</span><span class="Delimiter">);</span> -<span id="L1041" class="LineNr">1041 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"47"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L20'>EDI</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1034" class="LineNr">1034 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"40"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L13'>EAX</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1035" class="LineNr">1035 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"41"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L14'>ECX</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1036" class="LineNr">1036 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"42"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L15'>EDX</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1037" class="LineNr">1037 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"43"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L16'>EBX</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1038" class="LineNr">1038 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"44"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L17'>ESP</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1039" class="LineNr">1039 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"45"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L18'>EBP</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1040" class="LineNr">1040 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"46"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L19'>ESI</a> (inc)"</span><span class="Delimiter">);</span> +<span id="L1041" class="LineNr">1041 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"47"</span><span class="Delimiter">,</span> <span class="Constant">"increment <a href='010---vm.cc.html#L20'>EDI</a> (inc)"</span><span class="Delimiter">);</span> <span id="L1042" class="LineNr">1042 </span> <span id="L1043" class="LineNr">1043 </span><span class="Delimiter">:(code)</span> <span id="L1044" class="LineNr">1044 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1044'>test_increment_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1045" class="LineNr">1045 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>u = <span class="Constant">0x1f</span><span class="Delimiter">;</span> -<span id="L1046" class="LineNr">1046 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1046" class="LineNr">1046 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1047" class="LineNr">1047 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1048" class="LineNr">1048 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1049" class="LineNr">1049 </span> <span class="Constant">" 41 \n"</span> <span class="Comment">// increment ECX</span> @@ -1127,17 +1127,17 @@ if ('onhashchange' in window) { <span id="L1066" class="LineNr">1066 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> <a href='010---vm.cc.html#L23'>reg</a> = op & <span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L1067" class="LineNr">1067 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"increment "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span><a href='010---vm.cc.html#L23'>reg</a><span class="Delimiter">)</span> << end<span class="Delimiter">();</span> <span id="L1068" class="LineNr">1068 </span> ++<span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg]<span class="Delimiter">.</span>u<span class="Delimiter">;</span> -<span id="L1069" class="LineNr">1069 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> +<span id="L1069" class="LineNr">1069 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> <span id="L1070" class="LineNr">1070 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L1071" class="LineNr">1071 </span><span class="Delimiter">}</span> <span id="L1072" class="LineNr">1072 </span> <span id="L1073" class="LineNr">1073 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L1074" class="LineNr">1074 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"ff"</span><span class="Delimiter">,</span> <span class="Constant">"increment/decrement/jump/push/call rm32 based on subop (inc/dec/jmp/push/call)"</span><span class="Delimiter">);</span> +<span id="L1074" class="LineNr">1074 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"ff"</span><span class="Delimiter">,</span> <span class="Constant">"increment/decrement/jump/push/call rm32 based on subop (inc/dec/jmp/push/call)"</span><span class="Delimiter">);</span> <span id="L1075" class="LineNr">1075 </span> <span id="L1076" class="LineNr">1076 </span><span class="Delimiter">:(code)</span> <span id="L1077" class="LineNr">1077 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1077'>test_increment_rm32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1078" class="LineNr">1078 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u = <span class="Constant">0x20</span><span class="Delimiter">;</span> -<span id="L1079" class="LineNr">1079 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1079" class="LineNr">1079 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1080" class="LineNr">1080 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1081" class="LineNr">1081 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1082" class="LineNr">1082 </span> <span class="Constant">" ff c0 \n"</span> <span class="Comment">// increment EAX</span> @@ -1152,18 +1152,18 @@ if ('onhashchange' in window) { <span id="L1091" class="LineNr">1091 </span> <span id="L1092" class="LineNr">1092 </span><span class="Delimiter">:(before "End Single-Byte Opcodes")</span> <span id="L1093" class="LineNr">1093 </span><span class="Normal">case</span> <span class="Constant">0xff</span>: <span class="Delimiter">{</span> -<span id="L1094" class="LineNr">1094 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L339'>next</a><span class="Delimiter">();</span> +<span id="L1094" class="LineNr">1094 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L328'>next</a><span class="Delimiter">();</span> <span id="L1095" class="LineNr">1095 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> subop = <span class="Delimiter">(</span>modrm>><span class="Constant">3</span><span class="Delimiter">)</span>&<span class="Constant">0x7</span><span class="Delimiter">;</span> <span class="Comment">// middle 3 'reg opcode' bits</span> <span id="L1096" class="LineNr">1096 </span> <span class="Normal">switch</span> <span class="Delimiter">(</span>subop<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L1097" class="LineNr">1097 </span> <span class="Normal">case</span> <span class="Constant">0</span>: <span class="Delimiter">{</span> <span class="Comment">// increment r/m32</span> <span id="L1098" class="LineNr">1098 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"increment r/m32"</span> << end<span class="Delimiter">();</span> <span id="L1099" class="LineNr">1099 </span> <span class="Normal">int32_t</span>* <a href='001help.cc.html#L15'>arg</a> = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L1100" class="LineNr">1100 </span> ++*arg<span class="Delimiter">;</span> -<span id="L1101" class="LineNr">1101 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg << end<span class="Delimiter">();</span> +<span id="L1101" class="LineNr">1101 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg << end<span class="Delimiter">();</span> <span id="L1102" class="LineNr">1102 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L1103" class="LineNr">1103 </span> <span class="Delimiter">}</span> <span id="L1104" class="LineNr">1104 </span> <span class="Normal">default</span>: -<span id="L1105" class="LineNr">1105 </span> cerr << <span class="Constant">"unrecognized subop for ff: "</span> << <a href='010---vm.cc.html#L408'>HEXBYTE</a> << <a href='010---vm.cc.html#L411'>NUM</a><span class="Delimiter">(</span>subop<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L1105" class="LineNr">1105 </span> cerr << <span class="Constant">"unrecognized subop for ff: "</span> << <a href='010---vm.cc.html#L397'>HEXBYTE</a> << <a href='010---vm.cc.html#L400'>NUM</a><span class="Delimiter">(</span>subop<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L1106" class="LineNr">1106 </span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L1107" class="LineNr">1107 </span> <span class="Comment">// End Op ff Subops</span> <span id="L1108" class="LineNr">1108 </span> <span class="Delimiter">}</span> @@ -1173,19 +1173,19 @@ if ('onhashchange' in window) { <span id="L1112" class="LineNr">1112 </span><span class="SalientComment">//:: decrement</span> <span id="L1113" class="LineNr">1113 </span> <span id="L1114" class="LineNr">1114 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L1115" class="LineNr">1115 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"48"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L13'>EAX</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1116" class="LineNr">1116 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"49"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L14'>ECX</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1117" class="LineNr">1117 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4a"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L15'>EDX</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1118" class="LineNr">1118 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4b"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L16'>EBX</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1119" class="LineNr">1119 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4c"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L17'>ESP</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1120" class="LineNr">1120 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4d"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L18'>EBP</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1121" class="LineNr">1121 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4e"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L19'>ESI</a> (dec)"</span><span class="Delimiter">);</span> -<span id="L1122" class="LineNr">1122 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4f"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L20'>EDI</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1115" class="LineNr">1115 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"48"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L13'>EAX</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1116" class="LineNr">1116 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"49"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L14'>ECX</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1117" class="LineNr">1117 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4a"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L15'>EDX</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1118" class="LineNr">1118 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4b"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L16'>EBX</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1119" class="LineNr">1119 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4c"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L17'>ESP</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1120" class="LineNr">1120 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4d"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L18'>EBP</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1121" class="LineNr">1121 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4e"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L19'>ESI</a> (dec)"</span><span class="Delimiter">);</span> +<span id="L1122" class="LineNr">1122 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"4f"</span><span class="Delimiter">,</span> <span class="Constant">"decrement <a href='010---vm.cc.html#L20'>EDI</a> (dec)"</span><span class="Delimiter">);</span> <span id="L1123" class="LineNr">1123 </span> <span id="L1124" class="LineNr">1124 </span><span class="Delimiter">:(code)</span> <span id="L1125" class="LineNr">1125 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1125'>test_decrement_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1126" class="LineNr">1126 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ECX]<span class="Delimiter">.</span>u = <span class="Constant">0x1f</span><span class="Delimiter">;</span> -<span id="L1127" class="LineNr">1127 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1127" class="LineNr">1127 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1128" class="LineNr">1128 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1129" class="LineNr">1129 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1130" class="LineNr">1130 </span> <span class="Constant">" 49 \n"</span> <span class="Comment">// decrement ECX</span> @@ -1208,14 +1208,14 @@ if ('onhashchange' in window) { <span id="L1147" class="LineNr">1147 </span> <span class="Normal">const</span> <span class="Normal">uint8_t</span> <a href='010---vm.cc.html#L23'>reg</a> = op & <span class="Constant">0x7</span><span class="Delimiter">;</span> <span id="L1148" class="LineNr">1148 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"decrement "</span> << <a href='013direct_addressing.cc.html#L136'>rname</a><span class="Delimiter">(</span><a href='010---vm.cc.html#L23'>reg</a><span class="Delimiter">)</span> << end<span class="Delimiter">();</span> <span id="L1149" class="LineNr">1149 </span> --<span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg]<span class="Delimiter">.</span>u<span class="Delimiter">;</span> -<span id="L1150" class="LineNr">1150 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> +<span id="L1150" class="LineNr">1150 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[reg]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> <span id="L1151" class="LineNr">1151 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L1152" class="LineNr">1152 </span><span class="Delimiter">}</span> <span id="L1153" class="LineNr">1153 </span> <span id="L1154" class="LineNr">1154 </span><span class="Delimiter">:(code)</span> <span id="L1155" class="LineNr">1155 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1155'>test_decrement_rm32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1156" class="LineNr">1156 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EAX]<span class="Delimiter">.</span>u = <span class="Constant">0x20</span><span class="Delimiter">;</span> -<span id="L1157" class="LineNr">1157 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1157" class="LineNr">1157 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1158" class="LineNr">1158 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1159" class="LineNr">1159 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1160" class="LineNr">1160 </span> <span class="Constant">" ff c8 \n"</span> <span class="Comment">// decrement EAX</span> @@ -1233,28 +1233,28 @@ if ('onhashchange' in window) { <span id="L1172" class="LineNr">1172 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"decrement r/m32"</span> << end<span class="Delimiter">();</span> <span id="L1173" class="LineNr">1173 </span> <span class="Normal">int32_t</span>* <a href='001help.cc.html#L15'>arg</a> = <a href='013direct_addressing.cc.html#L101'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span> <span id="L1174" class="LineNr">1174 </span> --*arg<span class="Delimiter">;</span> -<span id="L1175" class="LineNr">1175 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << *arg << end<span class="Delimiter">();</span> +<span id="L1175" class="LineNr">1175 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"storing value 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << *arg << end<span class="Delimiter">();</span> <span id="L1176" class="LineNr">1176 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L1177" class="LineNr">1177 </span><span class="Delimiter">}</span> <span id="L1178" class="LineNr">1178 </span> <span id="L1179" class="LineNr">1179 </span><span class="SalientComment">//:: push</span> <span id="L1180" class="LineNr">1180 </span> <span id="L1181" class="LineNr">1181 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L1182" class="LineNr">1182 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"50"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L13'>EAX</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1183" class="LineNr">1183 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"51"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L14'>ECX</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1184" class="LineNr">1184 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"52"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L15'>EDX</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1185" class="LineNr">1185 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"53"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L16'>EBX</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1186" class="LineNr">1186 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"54"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L17'>ESP</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1187" class="LineNr">1187 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"55"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L18'>EBP</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1188" class="LineNr">1188 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"56"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L19'>ESI</a> to stack (push)"</span><span class="Delimiter">);</span> -<span id="L1189" class="LineNr">1189 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"57"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L20'>EDI</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1182" class="LineNr">1182 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"50"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L13'>EAX</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1183" class="LineNr">1183 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"51"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L14'>ECX</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1184" class="LineNr">1184 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"52"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L15'>EDX</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1185" class="LineNr">1185 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"53"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L16'>EBX</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1186" class="LineNr">1186 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"54"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L17'>ESP</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1187" class="LineNr">1187 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"55"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L18'>EBP</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1188" class="LineNr">1188 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"56"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L19'>ESI</a> to stack (push)"</span><span class="Delimiter">);</span> +<span id="L1189" class="LineNr">1189 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"57"</span><span class="Delimiter">,</span> <span class="Constant">"push <a href='010---vm.cc.html#L20'>EDI</a> to stack (push)"</span><span class="Delimiter">);</span> <span id="L1190" class="LineNr">1190 </span> <span id="L1191" class="LineNr">1191 </span><span class="Delimiter">:(code)</span> <span id="L1192" class="LineNr">1192 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1192'>test_push_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1193" class="LineNr">1193 </span> <span class="Special"><a href='010---vm.cc.html#L157'>Mem</a></span><span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>vma<span class="Delimiter">(</span><span class="Constant">0xbd000000</span><span class="Delimiter">));</span> <span class="Comment">// manually allocate memory</span> <span id="L1194" class="LineNr">1194 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u = <span class="Constant">0xbd000008</span><span class="Delimiter">;</span> <span id="L1195" class="LineNr">1195 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[EBX]<span class="Delimiter">.</span>i = <span class="Constant">0x0000000a</span><span class="Delimiter">;</span> -<span id="L1196" class="LineNr">1196 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1196" class="LineNr">1196 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1197" class="LineNr">1197 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1198" class="LineNr">1198 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1199" class="LineNr">1199 </span> <span class="Constant">" 53 \n"</span> <span class="Comment">// push EBX to stack</span> @@ -1285,21 +1285,21 @@ if ('onhashchange' in window) { <span id="L1224" class="LineNr">1224 </span><span class="SalientComment">//:: pop</span> <span id="L1225" class="LineNr">1225 </span> <span id="L1226" class="LineNr">1226 </span><span class="Delimiter">:(before "End Initialize Op Names")</span> -<span id="L1227" class="LineNr">1227 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"58"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L13'>EAX</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1228" class="LineNr">1228 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"59"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L14'>ECX</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1229" class="LineNr">1229 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5a"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L15'>EDX</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1230" class="LineNr">1230 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5b"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L16'>EBX</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1231" class="LineNr">1231 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5c"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L17'>ESP</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1232" class="LineNr">1232 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5d"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L18'>EBP</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1233" class="LineNr">1233 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5e"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L19'>ESI</a> (pop)"</span><span class="Delimiter">);</span> -<span id="L1234" class="LineNr">1234 </span><a href='001help.cc.html#L261'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L356'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5f"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L20'>EDI</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1227" class="LineNr">1227 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"58"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L13'>EAX</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1228" class="LineNr">1228 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"59"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L14'>ECX</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1229" class="LineNr">1229 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5a"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L15'>EDX</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1230" class="LineNr">1230 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5b"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L16'>EBX</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1231" class="LineNr">1231 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5c"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L17'>ESP</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1232" class="LineNr">1232 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5d"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L18'>EBP</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1233" class="LineNr">1233 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5e"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L19'>ESI</a> (pop)"</span><span class="Delimiter">);</span> +<span id="L1234" class="LineNr">1234 </span><a href='001help.cc.html#L260'>put_new</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L345'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">"5f"</span><span class="Delimiter">,</span> <span class="Constant">"pop top of stack to <a href='010---vm.cc.html#L20'>EDI</a> (pop)"</span><span class="Delimiter">);</span> <span id="L1235" class="LineNr">1235 </span> <span id="L1236" class="LineNr">1236 </span><span class="Delimiter">:(code)</span> <span id="L1237" class="LineNr">1237 </span><span class="Normal">void</span> <a href='013direct_addressing.cc.html#L1237'>test_pop_r32</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L1238" class="LineNr">1238 </span> <span class="Special"><a href='010---vm.cc.html#L157'>Mem</a></span><span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>vma<span class="Delimiter">(</span><span class="Constant">0xbd000000</span><span class="Delimiter">));</span> <span class="Comment">// manually allocate memory</span> <span id="L1239" class="LineNr">1239 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u = <span class="Constant">0xbd000008</span><span class="Delimiter">;</span> -<span id="L1240" class="LineNr">1240 </span> <a href='010---vm.cc.html#L257'>write_mem_i32</a><span class="Delimiter">(</span><span class="Constant">0xbd000008</span><span class="Delimiter">,</span> <span class="Constant">0x0000000a</span><span class="Delimiter">);</span> <span class="Comment">// ..before this write</span> -<span id="L1241" class="LineNr">1241 </span> <a href='011run.cc.html#L85'>run</a><span class="Delimiter">(</span> +<span id="L1240" class="LineNr">1240 </span> <a href='010---vm.cc.html#L246'>write_mem_i32</a><span class="Delimiter">(</span><span class="Constant">0xbd000008</span><span class="Delimiter">,</span> <span class="Constant">0x0000000a</span><span class="Delimiter">);</span> <span class="Comment">// ..before this write</span> +<span id="L1241" class="LineNr">1241 </span> <a href='011run.cc.html#L83'>run</a><span class="Delimiter">(</span> <span id="L1242" class="LineNr">1242 </span> <span class="Constant">"== code 0x1\n"</span> <span class="Comment">// code segment</span> <span id="L1243" class="LineNr">1243 </span> <span class="Comment">// op ModR/M SIB displacement immediate</span> <span id="L1244" class="LineNr">1244 </span> <span class="Constant">" 5b \n"</span> <span class="Comment">// pop stack to EBX</span> @@ -1331,10 +1331,10 @@ if ('onhashchange' in window) { <span id="L1270" class="LineNr">1270 </span><span class="Delimiter">}</span> <span id="L1271" class="LineNr">1271 </span><span class="Delimiter">:(code)</span> <span id="L1272" class="LineNr">1272 </span><span class="Normal">uint32_t</span> <a href='013direct_addressing.cc.html#L1272'>pop</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> -<span id="L1273" class="LineNr">1273 </span> <span class="Normal">const</span> <span class="Normal">uint32_t</span> result = <a href='010---vm.cc.html#L186'>read_mem_u32</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u<span class="Delimiter">);</span> -<span id="L1274" class="LineNr">1274 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"popping value 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << result << end<span class="Delimiter">();</span> +<span id="L1273" class="LineNr">1273 </span> <span class="Normal">const</span> <span class="Normal">uint32_t</span> result = <a href='010---vm.cc.html#L175'>read_mem_u32</a><span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u<span class="Delimiter">);</span> +<span id="L1274" class="LineNr">1274 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"popping value 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << result << end<span class="Delimiter">();</span> <span id="L1275" class="LineNr">1275 </span> <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u += <span class="Constant">4</span><span class="Delimiter">;</span> -<span id="L1276" class="LineNr">1276 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"incrementing <a href='010---vm.cc.html#L17'>ESP</a> to 0x"</span> << <a href='010---vm.cc.html#L409'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> +<span id="L1276" class="LineNr">1276 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Special">Callstack_depth</span>+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"incrementing <a href='010---vm.cc.html#L17'>ESP</a> to 0x"</span> << <a href='010---vm.cc.html#L398'>HEXWORD</a> << <span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u << end<span class="Delimiter">();</span> <span id="L1277" class="LineNr">1277 </span> assert<span class="Delimiter">(</span><span class="Special"><a href='010---vm.cc.html#L28'>Reg</a></span>[ESP]<span class="Delimiter">.</span>u < <a href='012elf.cc.html#L150'>AFTER_STACK</a><span class="Delimiter">);</span> <span id="L1278" class="LineNr">1278 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L1279" class="LineNr">1279 </span><span class="Delimiter">}</span> |