Skip to content

Commit

Permalink
x86: minor fixes for comments on MOV32cr etc: this is related to 64bi…
Browse files Browse the repository at this point in the history
…t code as well
  • Loading branch information
aquynh committed Apr 25, 2014
1 parent fe94c2b commit 7437a41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions arch/X86/X86DisassemblerDecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ static int readOpcode(struct InternalInstruction* insn)
if (consumeByte(insn, &current))
return -1;

// save this first byte for MOV32cr, MOV32dr, MOV32rc, MOV32rd
// save this first byte for MOVcr, MOVdr, MOVrc, MOVrd
insn->firstByte = current;

if (current == 0x0f) {
Expand Down Expand Up @@ -1319,7 +1319,7 @@ static int readModRM(struct InternalInstruction* insn)
return -1;
insn->consumedModRM = TRUE;
insn->orgModRM = insn->modRM;
// handle MOV32cr, MOV32dr, MOV32rc, MOV32rd by pretending they have MRM.mod = 0xC
// handle MOVcr, MOVdr, MOVrc, MOVrd by pretending they have MRM.mod = 0xC
if ((insn->firstByte == 0x0f && insn->opcodeType == TWOBYTE) &&
(insn->opcode >= 0x20 && insn->opcode <= 0x23 ))
insn->modRM |= 0xC0;
Expand Down
2 changes: 1 addition & 1 deletion arch/X86/X86DisassemblerDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ typedef struct InternalInstruction {
BOOL consumedModRM;
uint8_t modRM;

// special data to handle MOV32cr, MOV32dr, MOV32rc, MOV32rd
// special data to handle MOVcr, MOVdr, MOVrc, MOVrd
uint8_t firstByte; // save the first byte in stream
uint8_t orgModRM; // save original modRM because we will modify modRM

Expand Down

0 comments on commit 7437a41

Please sign in to comment.