about summary refs log tree commit diff stats
path: root/subx/014immediate_addressing.cc
diff options
context:
space:
mode:
Diffstat (limited to 'subx/014immediate_addressing.cc')
-rw-r--r--subx/014immediate_addressing.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/subx/014immediate_addressing.cc b/subx/014immediate_addressing.cc
index 8c308a80..165cc446 100644
--- a/subx/014immediate_addressing.cc
+++ b/subx/014immediate_addressing.cc
@@ -18,12 +18,12 @@ put(name, "81", "combine rm32 with imm32 based on subop");
 case 0x81: {  // combine imm32 with r/m32
   uint8_t modrm = next();
   int32_t arg2 = imm32();
-  trace(2, "run") << "combine imm32 0x" << HEXWORD << arg2 << " with r/m32" << end();
+  trace(90, "run") << "combine imm32 0x" << HEXWORD << arg2 << " with r/m32" << end();
   int32_t* arg1 = effective_address(modrm);
   uint8_t subop = (modrm>>3)&0x7;  // middle 3 'reg opcode' bits
   switch (subop) {
   case 0:
-    trace(2, "run") << "subop add" << end();
+    trace(90, "run") << "subop add" << end();
     BINARY_ARITHMETIC_OP(+, *arg1, arg2);
     break;
   // End Op 81 Subops
@@ -65,7 +65,7 @@ put(name, "2d", "subtract imm32 from R0 (EAX)");
 :(before "End Single-Byte Opcodes")
 case 0x2d: {  // subtract imm32 from EAX
   int32_t arg2 = imm32();
-  trace(2, "run") << "subtract imm32 0x" << HEXWORD << arg2 << " from EAX" << end();
+  trace(90, "run") << "subtract imm32 0x" << HEXWORD << arg2 << " from EAX" << end();
   BINARY_ARITHMETIC_OP(-, Reg[EAX].i, arg2);
   break;
 }
@@ -87,7 +87,7 @@ case 0x2d: {  // subtract imm32 from EAX
 
 :(before "End Op 81 Subops")
 case 5: {
-  trace(2, "run") << "subop subtract" << end();
+  trace(90, "run") << "subop subtract" << end();
   BINARY_ARITHMETIC_OP(-, *arg1, arg2);
   break;
 }
@@ -121,7 +121,7 @@ put(name, "25", "R0 = bitwise AND of imm32 with R0 (EAX)");
 :(before "End Single-Byte Opcodes")
 case 0x25: {  // and imm32 with EAX
   int32_t arg2 = imm32();
-  trace(2, "run") << "and imm32 0x" << HEXWORD << arg2 << " with EAX" << end();
+  trace(90, "run") << "and imm32 0x" << HEXWORD << arg2 << " with EAX" << end();
   BINARY_BITWISE_OP(&, Reg[EAX].i, arg2);
   break;
 }
@@ -143,7 +143,7 @@ ff 00 00 00  # 0xff
 
 :(before "End Op 81 Subops")
 case 4: {
-  trace(2, "run") << "subop and" << end();
+  trace(90, "run") << "subop and" << end();
   BINARY_BITWISE_OP(&, *arg1, arg2);
   break;
 }
@@ -177,7 +177,7 @@ put(name, "0d", "R0 = bitwise OR of imm32 with R0 (EAX)");
 :(before "End Single-Byte Opcodes")
 case 0x0d: {  // or imm32 with EAX
   int32_t arg2 = imm32();
-  trace(2, "run") << "or imm32 0x" << HEXWORD << arg2 << " with EAX" << end();
+  trace(90, "run") << "or imm32 0x" << HEXWORD << arg2 << " with EAX" << end();
   BINARY_BITWISE_OP(|, Reg[EAX].i, arg2);
   break;
 }
@@ -199,7 +199,7 @@ a0 b0 c0 d0  # 0xd0c0b0a0
 
 :(before "End Op 81 Subops")
 case 1: {
-  trace(2, "run") << "subop or" << end();
+  trace(90, "run") << "subop or" << end();
   BINARY_BITWISE_OP(|, *arg1, arg2);
   break;
 }
@@ -231,7 +231,7 @@ put(name, "35", "R0 = bitwise XOR of imm32 with R0 (EAX)");
 :(before "End Single-Byte Opcodes")
 case 0x35: {  // xor imm32 with EAX
   int32_t arg2 = imm32();
-  trace(2, "run") << "xor imm32 0x" << HEXWORD << arg2 << " with EAX" << end();
+  trace(90, "run") << "xor imm32 0x" << HEXWORD << arg2 << " with EAX" << end();
   BINARY_BITWISE_OP(^, Reg[EAX].i, arg2);
   break;
 }
@@ -253,7 +253,7 @@ a0 b0 c0 d0  # 0xd0c0b0a0
 
 :(before "End Op 81 Subops")
 case 6: {
-  trace(2, "run") << "subop xor" << end();
+  trace(90, "run") << "subop xor" << end();
   BINARY_BITWISE_OP(^, *arg1, arg2);
   break;
 }
@@ -286,13 +286,13 @@ put(name, "3d", "subtract imm32 from R0 (EAX)");
 case 0x3d: {  // subtract imm32 from EAX
   int32_t arg1 = Reg[EAX].i;
   int32_t arg2 = imm32();
-  trace(2, "run") << "compare EAX and imm32 0x" << HEXWORD << arg2 << end();
+  trace(90, "run") << "compare EAX and imm32 0x" << HEXWORD << arg2 << end();
   int32_t tmp1 = arg1 - arg2;
   SF = (tmp1 < 0);
   ZF = (tmp1 == 0);
   int64_t tmp2 = arg1 - arg2;
   OF = (tmp1 != tmp2);
-  trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end();
+  trace(90, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end();
   break;
 }
 
@@ -326,13 +326,13 @@ case 0x3d: {  // subtract imm32 from EAX
 
 :(before "End Op 81 Subops")
 case 7: {
-  trace(2, "run") << "subop compare" << end();
+  trace(90, "run") << "subop compare" << end();
   int32_t tmp1 = *arg1 - arg2;
   SF = (tmp1 < 0);
   ZF = (tmp1 == 0);
   int64_t tmp2 = *arg1 - arg2;
   OF = (tmp1 != tmp2);
-  trace(2, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end();
+  trace(90, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end();
   break;
 }
 
@@ -422,7 +422,7 @@ case 0xbe:
 case 0xbf: {  // copy imm32 to r32
   uint8_t reg1 = op & 0x7;
   int32_t arg2 = imm32();
-  trace(2, "run") << "copy imm32 0x" << HEXWORD << arg2 << " to " << rname(reg1) << end();
+  trace(90, "run") << "copy imm32 0x" << HEXWORD << arg2 << " to " << rname(reg1) << end();
   Reg[reg1].i = arg2;
   break;
 }
@@ -445,7 +445,7 @@ put(name, "c7", "copy imm32 to rm32");
 case 0xc7: {  // copy imm32 to r32
   uint8_t modrm = next();
   int32_t arg2 = imm32();
-  trace(2, "run") << "copy imm32 0x" << HEXWORD << arg2 << " to r/m32" << end();
+  trace(90, "run") << "copy imm32 0x" << HEXWORD << arg2 << " to r/m32" << end();
   int32_t* arg1 = effective_address(modrm);
   *arg1 = arg2;
   break;
@@ -468,10 +468,10 @@ put(name, "68", "push imm32 to stack");
 :(before "End Single-Byte Opcodes")
 case 0x68: {
   int32_t val = imm32();
-  trace(2, "run") << "push imm32 0x" << HEXWORD << val << end();
+  trace(90, "run") << "push imm32 0x" << HEXWORD << val << end();
   Reg[ESP].u -= 4;
   write_mem_i32(Reg[ESP].u, val);
-  trace(2, "run") << "ESP is now 0x" << HEXWORD << Reg[ESP].u << end();
-  trace(2, "run") << "contents at ESP: 0x" << HEXWORD << read_mem_u32(Reg[ESP].u) << end();
+  trace(90, "run") << "ESP is now 0x" << HEXWORD << Reg[ESP].u << end();
+  trace(90, "run") << "contents at ESP: 0x" << HEXWORD << read_mem_u32(Reg[ESP].u) << end();
   break;
 }