Skip to content

Commit

Permalink
popcnt: Check for prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Jun 20, 2017
1 parent 2710114 commit d79994d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/instructions.js
Expand Up @@ -3466,10 +3466,18 @@ t32[0xB7] = cpu => { cpu.read_modrm_byte();

t16[0xB8] = cpu => { cpu.read_modrm_byte();
// popcnt
if((cpu.prefixes & PREFIX_REPZ) === 0)
{
cpu.trigger_ud();
}
var data = cpu.read_e16();
cpu.write_g16(cpu.popcnt(data));
};
t32[0xB8] = cpu => { cpu.read_modrm_byte();
if((cpu.prefixes & PREFIX_REPZ) === 0)
{
cpu.trigger_ud();
}
var data = cpu.read_e32s();
cpu.write_g32(cpu.popcnt(data));
};
Expand Down

0 comments on commit d79994d

Please sign in to comment.