Skip to content

Commit

Permalink
x86: fix movw instruction in capstone-engine#789
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Nov 8, 2016
1 parent a2d62f9 commit c86e78f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arch/X86/X86ATTInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
}
}
} else {
SStream_concat0(O, "0");
//SStream_concat0(O, "0");
}
}

Expand Down
11 changes: 7 additions & 4 deletions arch/X86/X86GenAsmWriter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14168,12 +14168,15 @@ static void printInstruction(MCInst *MI, SStream *O, MCRegisterInfo *MRI)
uint64_t Bits2 = OpInfo2[opcode];
uint64_t Bits = (Bits2 << 32) | Bits1;
// assert(Bits != 0 && "Cannot print this instruction.");
if (!X86_lockrep(MI, O))
if (!X86_lockrep(MI, O)) {
#ifndef CAPSTONE_DIET
SStream_concat0(O, AsmStrs+(Bits & 16383)-1);
#else
;
// HACK TODO
if (opcode == X86_MOV32sm) {
SStream_concat0(O, "movw\t");
} else
SStream_concat0(O, AsmStrs+(Bits & 16383)-1);
#endif
}


// Fragment 0 encoded into 7 bits for 79 unique commands.
Expand Down
2 changes: 1 addition & 1 deletion cstool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else
endif

clean:
${RM} -rf *.o cstool
${RM} -rf *.o $(TARGET)

%.o: %.c
ifeq ($(V),0)
Expand Down

0 comments on commit c86e78f

Please sign in to comment.