This commit is contained in:
Kartik K. Agaram 2017-10-13 01:23:55 -07:00
parent 8745e7456a
commit 5a25c6e66f
2 changed files with 38 additions and 0 deletions

View File

@ -125,3 +125,26 @@ case 0x31: { // xor r32 with r/m32
BINARY_BITWISE_OP(^, *arg1, Reg[arg2].u);
break;
}
//:: not
:(scenario not_r32)
% Reg[3].i = 0x0f0f00ff;
# op ModR/M SIB displacement immediate
f7 c3 # not EBX (reg 3)
+run: 'not' of effective address
+run: effective address is reg 3
+run: storing 0xf0f0ff00
:(before "End Single-Byte Opcodes")
case 0xf7: { // xor r32 with r/m32
uint8_t modrm = next();
trace(2, "run") << "'not' of effective address" << end();
int32_t* arg1 = effective_address(modrm);
*arg1 = ~(*arg1);
trace(2, "run") << "storing 0x" << HEXWORD << *arg1 << end();
SF = (*arg1 >> 31);
ZF = (*arg1 == 0);
OF = false;
break;
}

View File

@ -196,3 +196,18 @@ case 0x33: { // xor r/m32 with r32
BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2);
break;
}
//:: not
:(scenario not_r32_with_mem_at_r32)
% Reg[3].i = 0x60;
# word at 0x60 is 0x0f0f00ff
% Mem.at(0x60) = 0xff;
% Mem.at(0x61) = 0x00;
% Mem.at(0x62) = 0x0f;
% Mem.at(0x63) = 0x0f;
# op ModRM SIB displacement immediate
f7 03 # negate *EBX (reg 3)
+run: 'not' of effective address
+run: effective address is mem at address 0x60 (reg 3)
+run: storing 0xf0f0ff00