This commit is contained in:
Kartik Agaram 2018-10-12 23:15:34 -07:00
parent 88b478087e
commit 544fbdc6e2
2 changed files with 10 additions and 10 deletions

View File

@ -343,11 +343,11 @@ put(name, "89", "copy r32 to rm32");
:(before "End Single-Byte Opcodes")
case 0x89: { // copy r32 to r/m32
uint8_t modrm = next();
uint8_t reg2 = (modrm>>3)&0x7;
trace(90, "run") << "copy " << rname(reg2) << " to r/m32" << end();
int32_t* arg1 = effective_address(modrm);
*arg1 = Reg[reg2].i;
trace(90, "run") << "storing 0x" << HEXWORD << *arg1 << end();
uint8_t rsrc = (modrm>>3)&0x7;
trace(90, "run") << "copy " << rname(rsrc) << " to r/m32" << end();
int32_t* dest = effective_address(modrm);
*dest = Reg[rsrc].i;
trace(90, "run") << "storing 0x" << HEXWORD << *dest << end();
break;
}

View File

@ -404,12 +404,12 @@ f0 cc bb aa # 0xf0 with more data in following bytes
:(before "End Single-Byte Opcodes")
case 0x88: { // copy r8 to r/m8
uint8_t modrm = next();
uint8_t reg2 = (modrm>>3)&0x7;
trace(90, "run") << "copy lowermost byte of " << rname(reg2) << " to r8/m8-at-r32" << end();
uint8_t rsrc = (modrm>>3)&0x7;
trace(90, "run") << "copy lowermost byte of " << rname(rsrc) << " to r8/m8-at-r32" << end();
// use unsigned to zero-extend 8-bit value to 32 bits
uint8_t* arg1 = reinterpret_cast<uint8_t*>(effective_address(modrm));
*arg1 = Reg[reg2].u;
trace(90, "run") << "storing 0x" << HEXBYTE << NUM(*arg1) << end();
uint8_t* dest = reinterpret_cast<uint8_t*>(effective_address(modrm));
*dest = Reg[rsrc].u;
trace(90, "run") << "storing 0x" << HEXBYTE << NUM(*dest) << end();
break;
}