From 311297cb006201f4706704b32c762630806c7adb Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 14 Oct 2017 23:33:27 -0700 Subject: 4066 I spent a while spelunking into the code generated by C compilers before realizing that ignoring the order of arguments for 'cmp' instructions clarifies everything. --- html/subx/011direct_addressing.cc.html | 2 +- html/subx/012indirect_addressing.cc.html | 2 +- subx/011direct_addressing.cc | 2 +- subx/012indirect_addressing.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/html/subx/011direct_addressing.cc.html b/html/subx/011direct_addressing.cc.html index 8638ecfe..67117464 100644 --- a/html/subx/011direct_addressing.cc.html +++ b/html/subx/011direct_addressing.cc.html @@ -226,7 +226,7 @@ if ('onhashchange' in window) { 161 +run: SF=0; ZF=0; OF=0 162 163 :(before "End Single-Byte Opcodes") -164 case 0x39: { // compare r32 with r/m32 +164 case 0x39: { // set SF if r/m32 < r32 165 uint8_t modrm = next(); 166 uint8_t reg2 = (modrm>>3)&0x7; 167 trace(2, "run") << "compare reg " << NUM(reg2) << " with effective address" << end(); diff --git a/html/subx/012indirect_addressing.cc.html b/html/subx/012indirect_addressing.cc.html index 72211ce3..ab3650f6 100644 --- a/html/subx/012indirect_addressing.cc.html +++ b/html/subx/012indirect_addressing.cc.html @@ -302,7 +302,7 @@ if ('onhashchange' in window) { 238 +run: SF=0; ZF=0; OF=0 239 240 :(before "End Single-Byte Opcodes") -241 case 0x3b: { // compare r/m32 with r32 +241 case 0x3b: { // set SF if r32 < r/m32 242 uint8_t modrm = next(); 243 uint8_t reg1 = (modrm>>3)&0x7; 244 trace(2, "run") << "compare effective address with reg " << NUM(reg1) << end(); diff --git a/subx/011direct_addressing.cc b/subx/011direct_addressing.cc index facc8378..a12b5541 100644 --- a/subx/011direct_addressing.cc +++ b/subx/011direct_addressing.cc @@ -161,7 +161,7 @@ case 0xf7: { // xor r32 with r/m32 +run: SF=0; ZF=0; OF=0 :(before "End Single-Byte Opcodes") -case 0x39: { // compare r32 with r/m32 +case 0x39: { // set SF if r/m32 < r32 uint8_t modrm = next(); uint8_t reg2 = (modrm>>3)&0x7; trace(2, "run") << "compare reg " << NUM(reg2) << " with effective address" << end(); diff --git a/subx/012indirect_addressing.cc b/subx/012indirect_addressing.cc index 38c3d234..546df707 100644 --- a/subx/012indirect_addressing.cc +++ b/subx/012indirect_addressing.cc @@ -238,7 +238,7 @@ case 0x33: { // xor r/m32 with r32 +run: SF=0; ZF=0; OF=0 :(before "End Single-Byte Opcodes") -case 0x3b: { // compare r/m32 with r32 +case 0x3b: { // set SF if r32 < r/m32 uint8_t modrm = next(); uint8_t reg1 = (modrm>>3)&0x7; trace(2, "run") << "compare effective address with reg " << NUM(reg1) << end(); -- cgit 1.4.1-2-gfad0