about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-10-14 23:33:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-10-14 23:35:00 -0700
commit311297cb006201f4706704b32c762630806c7adb (patch)
treeeacf64f46008fd48caf898d583a8bdac986b0baf /subx
parentc67ca4b92674620f3cae3b9301471e0321a7936c (diff)
downloadmu-311297cb006201f4706704b32c762630806c7adb.tar.gz
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.
Diffstat (limited to 'subx')
-rw-r--r--subx/011direct_addressing.cc2
-rw-r--r--subx/012indirect_addressing.cc2
2 files changed, 2 insertions, 2 deletions
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();