From 3dedbe9ce368d82b1310beca2695728fd8ed70c8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 Oct 2017 02:58:42 -0700 Subject: 4072 --- html/subx/010core.cc.html | 8 +- html/subx/011direct_addressing.cc.html | 6 +- html/subx/012indirect_addressing.cc.html | 4 +- html/subx/013immediate_addressing.cc.html | 71 ++----- html/subx/014jump_relative.cc.html | 320 +++++++++++++++++++++++++++++ html/subx/015jump_relative.cc.html | 326 ++++++++++++++++++++++++++++++ 6 files changed, 667 insertions(+), 68 deletions(-) create mode 100644 html/subx/014jump_relative.cc.html create mode 100644 html/subx/015jump_relative.cc.html (limited to 'html') diff --git a/html/subx/010core.cc.html b/html/subx/010core.cc.html index bea957fc..425859f5 100644 --- a/html/subx/010core.cc.html +++ b/html/subx/010core.cc.html @@ -90,10 +90,10 @@ if ('onhashchange' in window) { 27 28 :(before "End Globals") 29 bool SF = false; // sign flag - 30 bool ZF = false; // zero flag + 30 bool ZF = false; // zero flag 31 bool OF = false; // overflow flag 32 :(before "End Reset") - 33 SF = ZF = OF = false; + 33 SF = ZF = OF = false; 34 35 //: how the flag registers are updated after each instruction 36 @@ -107,7 +107,7 @@ if ('onhashchange' in window) { 44 arg1 = arg1 op arg2; \ 45 trace(2, "run") << "storing 0x" << HEXWORD << arg1 << end(); \ 46 SF = (arg1 < 0); \ - 47 ZF = (arg1 == 0); \ + 47 ZF = (arg1 == 0); \ 48 OF = (arg1 != tmp); \ 49 } 50 @@ -118,7 +118,7 @@ if ('onhashchange' in window) { 55 arg1 = arg1 op arg2; \ 56 trace(2, "run") << "storing 0x" << HEXWORD << arg1 << end(); \ 57 SF = (arg1 >> 31); \ - 58 ZF = (arg1 == 0); \ + 58 ZF = (arg1 == 0); \ 59 OF = false; \ 60 } 61 diff --git a/html/subx/011direct_addressing.cc.html b/html/subx/011direct_addressing.cc.html index ee7d3ce3..63a702cf 100644 --- a/html/subx/011direct_addressing.cc.html +++ b/html/subx/011direct_addressing.cc.html @@ -209,7 +209,7 @@ if ('onhashchange' in window) { 144 *arg1 = ~(*arg1); 145 trace(2, "run") << "storing 0x" << HEXWORD << *arg1 << end(); 146 SF = (*arg1 >> 31); -147 ZF = (*arg1 == 0); +147 ZF = (*arg1 == 0); 148 OF = false; 149 break; 150 } @@ -234,10 +234,10 @@ if ('onhashchange' in window) { 169 int32_t arg2 = Reg[reg2].i; 170 int32_t tmp1 = *arg1 - arg2; 171 SF = (tmp1 < 0); -172 ZF = (tmp1 == 0); +172 ZF = (tmp1 == 0); 173 int64_t tmp2 = *arg1 - arg2; 174 OF = (tmp1 != tmp2); -175 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); +175 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); 176 break; 177 } 178 diff --git a/html/subx/012indirect_addressing.cc.html b/html/subx/012indirect_addressing.cc.html index 8bf288af..ef408d32 100644 --- a/html/subx/012indirect_addressing.cc.html +++ b/html/subx/012indirect_addressing.cc.html @@ -311,10 +311,10 @@ if ('onhashchange' in window) { 246 int32_t* arg2 = effective_address(modrm); 247 int32_t tmp1 = arg1 - *arg2; 248 SF = (tmp1 < 0); -249 ZF = (tmp1 == 0); +249 ZF = (tmp1 == 0); 250 int64_t tmp2 = arg1 - *arg2; 251 OF = (tmp1 != tmp2); -252 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); +252 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); 253 break; 254 } 255 diff --git a/html/subx/013immediate_addressing.cc.html b/html/subx/013immediate_addressing.cc.html index 8b5be4ba..bb9e6ea8 100644 --- a/html/subx/013immediate_addressing.cc.html +++ b/html/subx/013immediate_addressing.cc.html @@ -15,20 +15,19 @@ body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.SalientComment { color: #00ffff; } -.LineNr { color: #444444; } -.traceContains { color: #008000; } -.traceAbsent { color: #c00000; } -.Delimiter { color: #800080; } -.Normal { color: #aaaaaa; background-color: #080808; padding-bottom: 1px; } -.cSpecial { color: #008000; } +.Constant { color: #00a0a0; } +.Special { color: #c00000; } .Conceal { color: #4e4e4e; } +.SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Comment a { color:#0000ee; text-decoration:underline; } -.Constant { color: #00a0a0; } -.Special { color: #c00000; } +.Delimiter { color: #800080; } +.LineNr { color: #444444; } .Identifier { color: #c0a020; } +.Normal { color: #aaaaaa; background-color: #080808; padding-bottom: 1px; } .PreProc { color: #800080; } +.cSpecial { color: #008000; } +.traceContains { color: #008000; } --> @@ -310,10 +309,10 @@ if ('onhashchange' in window) { 245 trace(2, "run") << "compare reg EAX and imm32 0x" << HEXWORD << arg2 << end(); 246 int32_t tmp1 = arg1 - arg2; 247 SF = (tmp1 < 0); -248 ZF = (tmp1 == 0); +248 ZF = (tmp1 == 0); 249 int64_t tmp2 = arg1 - arg2; 250 OF = (tmp1 != tmp2); -251 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); +251 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); 252 break; 253 } 254 @@ -346,10 +345,10 @@ if ('onhashchange' in window) { 281 trace(2, "run") << "subop compare" << end(); 282 int32_t tmp1 = *arg1 - arg2; 283 SF = (tmp1 < 0); -284 ZF = (tmp1 == 0); +284 ZF = (tmp1 == 0); 285 int64_t tmp2 = *arg1 - arg2; 286 OF = (tmp1 != tmp2); -287 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); +287 trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); 288 break; 289 } 290 @@ -431,52 +430,6 @@ if ('onhashchange' in window) { 366 *arg1 = arg2; 367 break; 368 } -369 -370 //:: jump -371 -372 :(scenario jump_rel8) -373 # op ModRM SIB displacement immediate -374 eb 05 # skip 1 instruction -375 05 00 00 00 01 -376 05 00 00 00 02 -377 +run: inst: 0x00000001 -378 +run: jump 5 -379 +run: inst: 0x00000008 -380 -run: inst: 0x00000003 -381 -382 :(before "End Single-Byte Opcodes") -383 case 0xeb: { // jump rel8 -384 int8_t offset = static_cast<int>(next()); -385 trace(2, "run") << "jump " << NUM(offset) << end(); -386 EIP += offset; -387 break; -388 } -389 -390 //: -391 -392 :(scenario jump_rel16) -393 # op ModRM SIB displacement immediate -394 e9 05 00 # skip 1 instruction -395 05 00 00 00 01 -396 05 00 00 00 02 -397 +run: inst: 0x00000001 -398 +run: jump 5 -399 +run: inst: 0x00000009 -400 -run: inst: 0x00000003 -401 -402 :(before "End Single-Byte Opcodes") -403 case 0xe9: { // jump rel8 -404 int16_t offset = imm16(); -405 trace(2, "run") << "jump " << offset << end(); -406 EIP += offset; -407 break; -408 } -409 :(code) -410 int16_t imm16() { -411 int16_t result = next(); -412 result |= (next()<<8); -413 return result; -414 } diff --git a/html/subx/014jump_relative.cc.html b/html/subx/014jump_relative.cc.html new file mode 100644 index 00000000..9722e271 --- /dev/null +++ b/html/subx/014jump_relative.cc.html @@ -0,0 +1,320 @@ + + + + +Mu - subx/014jump_relative.cc + + + + + + + + + + +
+  1 //: jump to 8-bit offset
+  2 
+  3 //:: jump
+  4 
+  5 :(scenario jump_rel8)
+  6 # op  ModRM   SIB   displacement  immediate
+  7   eb                05                        # skip 1 instruction
+  8   05                              00 00 00 01
+  9   05                              00 00 00 02
+ 10 +run: inst: 0x00000001
+ 11 +run: jump 5
+ 12 +run: inst: 0x00000008
+ 13 -run: inst: 0x00000003
+ 14 
+ 15 :(before "End Single-Byte Opcodes")
+ 16 case 0xeb: {  // jump rel8
+ 17   int8_t offset = static_cast<int>(next());
+ 18   trace(2, "run") << "jump " << NUM(offset) << end();
+ 19   EIP += offset;
+ 20   break;
+ 21 }
+ 22 
+ 23 //:: jump if equal/zero
+ 24 
+ 25 :(scenario je_rel8_success)
+ 26 % ZF = true;
+ 27 # op  ModRM   SIB   displacement  immediate
+ 28   74                05                        # skip 1 instruction
+ 29   05                              00 00 00 01
+ 30   05                              00 00 00 02
+ 31 +run: inst: 0x00000001
+ 32 +run: jump 5
+ 33 +run: inst: 0x00000008
+ 34 -run: inst: 0x00000003
+ 35 
+ 36 :(before "End Single-Byte Opcodes")
+ 37 case 0x74: {  // jump rel8 if ZF
+ 38   int8_t offset = static_cast<int>(next());
+ 39   if (ZF) {
+ 40   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+ 41   ¦ EIP += offset;
+ 42   }
+ 43   break;
+ 44 }
+ 45 
+ 46 :(scenario je_rel8_fail)
+ 47 % ZF = false;
+ 48 # op  ModRM   SIB   displacement  immediate
+ 49   74                05                        # skip 1 instruction
+ 50   05                              00 00 00 01
+ 51   05                              00 00 00 02
+ 52 +run: inst: 0x00000001
+ 53 +run: inst: 0x00000003
+ 54 +run: inst: 0x00000008
+ 55 -run: jump 5
+ 56 
+ 57 //:: jump if not equal/not zero
+ 58 
+ 59 :(scenario jne_rel8_success)
+ 60 % ZF = false;
+ 61 # op  ModRM   SIB   displacement  immediate
+ 62   75                05                        # skip 1 instruction
+ 63   05                              00 00 00 01
+ 64   05                              00 00 00 02
+ 65 +run: inst: 0x00000001
+ 66 +run: jump 5
+ 67 +run: inst: 0x00000008
+ 68 -run: inst: 0x00000003
+ 69 
+ 70 :(before "End Single-Byte Opcodes")
+ 71 case 0x75: {  // jump rel8 unless ZF
+ 72   int8_t offset = static_cast<int>(next());
+ 73   if (!ZF) {
+ 74   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+ 75   ¦ EIP += offset;
+ 76   }
+ 77   break;
+ 78 }
+ 79 
+ 80 :(scenario jne_rel8_fail)
+ 81 % ZF = true;
+ 82 # op  ModRM   SIB   displacement  immediate
+ 83   75                05                        # skip 1 instruction
+ 84   05                              00 00 00 01
+ 85   05                              00 00 00 02
+ 86 +run: inst: 0x00000001
+ 87 +run: inst: 0x00000003
+ 88 +run: inst: 0x00000008
+ 89 -run: jump 5
+ 90 
+ 91 //:: jump if greater
+ 92 
+ 93 :(scenario jg_rel8_success)
+ 94 % ZF = false;
+ 95 % SF = false;
+ 96 % OF = false;
+ 97 # op  ModRM   SIB   displacement  immediate
+ 98   7f                05                        # skip 1 instruction
+ 99   05                              00 00 00 01
+100   05                              00 00 00 02
+101 +run: inst: 0x00000001
+102 +run: jump 5
+103 +run: inst: 0x00000008
+104 -run: inst: 0x00000003
+105 
+106 :(before "End Single-Byte Opcodes")
+107 case 0x7f: {  // jump rel8 if !SF and !ZF
+108   int8_t offset = static_cast<int>(next());
+109   if (!ZF && SF == OF) {
+110   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+111   ¦ EIP += offset;
+112   }
+113   break;
+114 }
+115 
+116 :(scenario jg_rel8_fail)
+117 % ZF = false;
+118 % SF = true;
+119 % OF = false;
+120 # op  ModRM   SIB   displacement  immediate
+121   7f                05                        # skip 1 instruction
+122   05                              00 00 00 01
+123   05                              00 00 00 02
+124 +run: inst: 0x00000001
+125 +run: inst: 0x00000003
+126 +run: inst: 0x00000008
+127 -run: jump 5
+128 
+129 //:: jump if greater or equal
+130 
+131 :(scenario jge_rel8_success)
+132 % SF = false;
+133 % OF = false;
+134 # op  ModRM   SIB   displacement  immediate
+135   7d                05                        # skip 1 instruction
+136   05                              00 00 00 01
+137   05                              00 00 00 02
+138 +run: inst: 0x00000001
+139 +run: jump 5
+140 +run: inst: 0x00000008
+141 -run: inst: 0x00000003
+142 
+143 :(before "End Single-Byte Opcodes")
+144 case 0x7d: {  // jump rel8 if !SF
+145   int8_t offset = static_cast<int>(next());
+146   if (SF == OF) {
+147   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+148   ¦ EIP += offset;
+149   }
+150   break;
+151 }
+152 
+153 :(scenario jge_rel8_fail)
+154 % SF = true;
+155 % OF = false;
+156 # op  ModRM   SIB   displacement  immediate
+157   7d                05                        # skip 1 instruction
+158   05                              00 00 00 01
+159   05                              00 00 00 02
+160 +run: inst: 0x00000001
+161 +run: inst: 0x00000003
+162 +run: inst: 0x00000008
+163 -run: jump 5
+164 
+165 //:: jump if lesser
+166 
+167 :(scenario jl_rel8_success)
+168 % ZF = false;
+169 % SF = true;
+170 % OF = false;
+171 # op  ModRM   SIB   displacement  immediate
+172   7c                05                        # skip 1 instruction
+173   05                              00 00 00 01
+174   05                              00 00 00 02
+175 +run: inst: 0x00000001
+176 +run: jump 5
+177 +run: inst: 0x00000008
+178 -run: inst: 0x00000003
+179 
+180 :(before "End Single-Byte Opcodes")
+181 case 0x7c: {  // jump rel8 if SF and !ZF
+182   int8_t offset = static_cast<int>(next());
+183   if (SF != OF) {
+184   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+185   ¦ EIP += offset;
+186   }
+187   break;
+188 }
+189 
+190 :(scenario jl_rel8_fail)
+191 % ZF = false;
+192 % SF = false;
+193 % OF = false;
+194 # op  ModRM   SIB   displacement  immediate
+195   7c                05                        # skip 1 instruction
+196   05                              00 00 00 01
+197   05                              00 00 00 02
+198 +run: inst: 0x00000001
+199 +run: inst: 0x00000003
+200 +run: inst: 0x00000008
+201 -run: jump 5
+202 
+203 //:: jump if lesser or equal
+204 
+205 :(scenario jle_rel8_equal)
+206 % ZF = true;
+207 % SF = false;
+208 % OF = false;
+209 # op  ModRM   SIB   displacement  immediate
+210   7e                05                        # skip 1 instruction
+211   05                              00 00 00 01
+212   05                              00 00 00 02
+213 +run: inst: 0x00000001
+214 +run: jump 5
+215 +run: inst: 0x00000008
+216 -run: inst: 0x00000003
+217 
+218 :(scenario jle_rel8_lesser)
+219 % ZF = false;
+220 % SF = true;
+221 % OF = false;
+222 # op  ModRM   SIB   displacement  immediate
+223   7e                05                        # skip 1 instruction
+224   05                              00 00 00 01
+225   05                              00 00 00 02
+226 +run: inst: 0x00000001
+227 +run: jump 5
+228 +run: inst: 0x00000008
+229 -run: inst: 0x00000003
+230 
+231 :(before "End Single-Byte Opcodes")
+232 case 0x7e: {  // jump rel8 if SF or ZF
+233   int8_t offset = static_cast<int>(next());
+234   if (ZF || SF != OF) {
+235   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+236   ¦ EIP += offset;
+237   }
+238   break;
+239 }
+240 
+241 :(scenario jle_rel8_greater)
+242 % ZF = false;
+243 % SF = false;
+244 % OF = false;
+245 # op  ModRM   SIB   displacement  immediate
+246   7e                05                        # skip 1 instruction
+247   05                              00 00 00 01
+248   05                              00 00 00 02
+249 +run: inst: 0x00000001
+250 +run: inst: 0x00000003
+251 +run: inst: 0x00000008
+252 -run: jump 5
+
+ + + diff --git a/html/subx/015jump_relative.cc.html b/html/subx/015jump_relative.cc.html new file mode 100644 index 00000000..bc90c4a4 --- /dev/null +++ b/html/subx/015jump_relative.cc.html @@ -0,0 +1,326 @@ + + + + +Mu - subx/015jump_relative.cc + + + + + + + + + + +
+  1 //: jump to 16-bit offset
+  2 
+  3 //:: jump
+  4 
+  5 :(scenario jump_rel16)
+  6 # op  ModRM   SIB   displacement  immediate
+  7   e9                05 00                     # skip 1 instruction
+  8   05                              00 00 00 01
+  9   05                              00 00 00 02
+ 10 +run: inst: 0x00000001
+ 11 +run: jump 5
+ 12 +run: inst: 0x00000009
+ 13 -run: inst: 0x00000003
+ 14 
+ 15 :(before "End Single-Byte Opcodes")
+ 16 case 0xe9: {  // jump rel8
+ 17   int16_t offset = imm16();
+ 18   trace(2, "run") << "jump " << offset << end();
+ 19   EIP += offset;
+ 20   break;
+ 21 }
+ 22 :(code)
+ 23 int16_t imm16() {
+ 24   int16_t result = next();
+ 25   result |= (next()<<8);
+ 26   return result;
+ 27 }
+ 28 
+ 29 //:: jump if equal/zero
+ 30 
+ 31 :(scenario je_rel16_success)
+ 32 % ZF = true;
+ 33 # op  ModRM   SIB   displacement  immediate
+ 34   0f 84             05 00                     # skip 1 instruction
+ 35   05                              00 00 00 01
+ 36   05                              00 00 00 02
+ 37 +run: inst: 0x00000001
+ 38 +run: jump 5
+ 39 +run: inst: 0x0000000a
+ 40 -run: inst: 0x00000005
+ 41 
+ 42 :(before "End Two-Byte Opcodes Starting With 0f")
+ 43 case 0x84: {  // jump rel16 if ZF
+ 44   int8_t offset = imm16();
+ 45   if (ZF) {
+ 46   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+ 47   ¦ EIP += offset;
+ 48   }
+ 49   break;
+ 50 }
+ 51 
+ 52 :(scenario je_rel16_fail)
+ 53 % ZF = false;
+ 54 # op  ModRM   SIB   displacement  immediate
+ 55   0f 84             05 00                     # skip 1 instruction
+ 56   05                              00 00 00 01
+ 57   05                              00 00 00 02
+ 58 +run: inst: 0x00000001
+ 59 +run: inst: 0x00000005
+ 60 +run: inst: 0x0000000a
+ 61 -run: jump 5
+ 62 
+ 63 //:: jump if not equal/not zero
+ 64 
+ 65 :(scenario jne_rel16_success)
+ 66 % ZF = false;
+ 67 # op  ModRM   SIB   displacement  immediate
+ 68   0f 85             05 00                     # skip 1 instruction
+ 69   05                              00 00 00 01
+ 70   05                              00 00 00 02
+ 71 +run: inst: 0x00000001
+ 72 +run: jump 5
+ 73 +run: inst: 0x0000000a
+ 74 -run: inst: 0x00000005
+ 75 
+ 76 :(before "End Two-Byte Opcodes Starting With 0f")
+ 77 case 0x85: {  // jump rel16 unless ZF
+ 78   int8_t offset = imm16();
+ 79   if (!ZF) {
+ 80   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+ 81   ¦ EIP += offset;
+ 82   }
+ 83   break;
+ 84 }
+ 85 
+ 86 :(scenario jne_rel16_fail)
+ 87 % ZF = true;
+ 88 # op  ModRM   SIB   displacement  immediate
+ 89   0f 85             05 00                     # skip 1 instruction
+ 90   05                              00 00 00 01
+ 91   05                              00 00 00 02
+ 92 +run: inst: 0x00000001
+ 93 +run: inst: 0x00000005
+ 94 +run: inst: 0x0000000a
+ 95 -run: jump 5
+ 96 
+ 97 //:: jump if greater
+ 98 
+ 99 :(scenario jg_rel16_success)
+100 % ZF = false;
+101 % SF = false;
+102 % OF = false;
+103 # op  ModRM   SIB   displacement  immediate
+104   0f 8f             05 00                     # skip 1 instruction
+105   05                              00 00 00 01
+106   05                              00 00 00 02
+107 +run: inst: 0x00000001
+108 +run: jump 5
+109 +run: inst: 0x0000000a
+110 -run: inst: 0x00000005
+111 
+112 :(before "End Two-Byte Opcodes Starting With 0f")
+113 case 0x8f: {  // jump rel16 if !SF and !ZF
+114   int8_t offset = imm16();
+115   if (!ZF && SF == OF) {
+116   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+117   ¦ EIP += offset;
+118   }
+119   break;
+120 }
+121 
+122 :(scenario jg_rel16_fail)
+123 % ZF = false;
+124 % SF = true;
+125 % OF = false;
+126 # op  ModRM   SIB   displacement  immediate
+127   0f 8f             05 00                     # skip 1 instruction
+128   05                              00 00 00 01
+129   05                              00 00 00 02
+130 +run: inst: 0x00000001
+131 +run: inst: 0x00000005
+132 +run: inst: 0x0000000a
+133 -run: jump 5
+134 
+135 //:: jump if greater or equal
+136 
+137 :(scenario jge_rel16_success)
+138 % SF = false;
+139 % OF = false;
+140 # op  ModRM   SIB   displacement  immediate
+141   0f 8d             05 00                     # skip 1 instruction
+142   05                              00 00 00 01
+143   05                              00 00 00 02
+144 +run: inst: 0x00000001
+145 +run: jump 5
+146 +run: inst: 0x0000000a
+147 -run: inst: 0x00000005
+148 
+149 :(before "End Two-Byte Opcodes Starting With 0f")
+150 case 0x8d: {  // jump rel16 if !SF
+151   int8_t offset = imm16();
+152   if (SF == OF) {
+153   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+154   ¦ EIP += offset;
+155   }
+156   break;
+157 }
+158 
+159 :(scenario jge_rel16_fail)
+160 % SF = true;
+161 % OF = false;
+162 # op  ModRM   SIB   displacement  immediate
+163   0f 8d             05 00                     # skip 1 instruction
+164   05                              00 00 00 01
+165   05                              00 00 00 02
+166 +run: inst: 0x00000001
+167 +run: inst: 0x00000005
+168 +run: inst: 0x0000000a
+169 -run: jump 5
+170 
+171 //:: jump if lesser
+172 
+173 :(scenario jl_rel16_success)
+174 % ZF = false;
+175 % SF = true;
+176 % OF = false;
+177 # op  ModRM   SIB   displacement  immediate
+178   0f 8c             05 00                     # skip 1 instruction
+179   05                              00 00 00 01
+180   05                              00 00 00 02
+181 +run: inst: 0x00000001
+182 +run: jump 5
+183 +run: inst: 0x0000000a
+184 -run: inst: 0x00000005
+185 
+186 :(before "End Two-Byte Opcodes Starting With 0f")
+187 case 0x8c: {  // jump rel16 if SF and !ZF
+188   int8_t offset = imm16();
+189   if (SF != OF) {
+190   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+191   ¦ EIP += offset;
+192   }
+193   break;
+194 }
+195 
+196 :(scenario jl_rel16_fail)
+197 % ZF = false;
+198 % SF = false;
+199 % OF = false;
+200 # op  ModRM   SIB   displacement  immediate
+201   0f 8c             05 00                     # skip 1 instruction
+202   05                              00 00 00 01
+203   05                              00 00 00 02
+204 +run: inst: 0x00000001
+205 +run: inst: 0x00000005
+206 +run: inst: 0x0000000a
+207 -run: jump 5
+208 
+209 //:: jump if lesser or equal
+210 
+211 :(scenario jle_rel16_equal)
+212 % ZF = true;
+213 % SF = false;
+214 % OF = false;
+215 # op  ModRM   SIB   displacement  immediate
+216   0f 8e             05 00                     # skip 1 instruction
+217   05                              00 00 00 01
+218   05                              00 00 00 02
+219 +run: inst: 0x00000001
+220 +run: jump 5
+221 +run: inst: 0x0000000a
+222 -run: inst: 0x00000005
+223 
+224 :(scenario jle_rel16_lesser)
+225 % ZF = false;
+226 % SF = true;
+227 % OF = false;
+228 # op  ModRM   SIB   displacement  immediate
+229   0f 8e             05 00                     # skip 1 instruction
+230   05                              00 00 00 01
+231   05                              00 00 00 02
+232 +run: inst: 0x00000001
+233 +run: jump 5
+234 +run: inst: 0x0000000a
+235 -run: inst: 0x00000005
+236 
+237 :(before "End Two-Byte Opcodes Starting With 0f")
+238 case 0x8e: {  // jump rel16 if SF or ZF
+239   int8_t offset = imm16();
+240   if (ZF || SF != OF) {
+241   ¦ trace(2, "run") << "jump " << NUM(offset) << end();
+242   ¦ EIP += offset;
+243   }
+244   break;
+245 }
+246 
+247 :(scenario jle_rel16_greater)
+248 % ZF = false;
+249 % SF = false;
+250 % OF = false;
+251 # op  ModRM   SIB   displacement  immediate
+252   0f 8e             05 00                     # skip 1 instruction
+253   05                              00 00 00 01
+254   05                              00 00 00 02
+255 +run: inst: 0x00000001
+256 +run: inst: 0x00000005
+257 +run: inst: 0x0000000a
+258 -run: jump 5
+
+ + + -- cgit 1.4.1-2-gfad0