Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/TMS320C64x/TMS320C64xDisassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ bool TMS320C64x_getInstruction(csh ud, const uint8_t *code, size_t code_len,
if(MI->flat_insn->detail)
memset(MI->flat_insn->detail, 0, offsetof(cs_detail, tms320c64x)+sizeof(cs_tms320c64x));

insn = (code[3] << 0) | (code[2] << 8) | (code[1] << 16) | ((uint32_t) code[0] << 24);
insn = readBytes32(MI, code);
result = decodeInstruction_4(DecoderTable32, MI, insn, address, info, 0);

if(result == MCDisassembler_Success) {
Expand Down
10 changes: 10 additions & 0 deletions arch/TMS320C64x/TMS320C64xModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ cs_err TMS320C64x_global_init(cs_struct *ud)

cs_err TMS320C64x_option(cs_struct *handle, cs_opt_type type, size_t value)
{
switch (type) {
case CS_OPT_MODE:
handle->mode |= (cs_mode)value;
break;
case CS_OPT_SYNTAX:
handle->syntax |= (int)value;
break;
default:
break;
}
return CS_ERR_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static const struct {
{
TMS320C64x_global_init,
TMS320C64x_option,
~(CS_MODE_BIG_ENDIAN),
~(CS_MODE_LITTLE_ENDIAN | CS_MODE_BIG_ENDIAN),
},
#else
{ NULL, NULL, 0 },
Expand Down
1 change: 1 addition & 0 deletions cstool/cstool.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ static struct {
{ "m68k", CS_ARCH_M68K, CS_MODE_BIG_ENDIAN },
{ "m68k40", CS_ARCH_M68K, CS_MODE_M68K_040 },
{ "tms320c64x", CS_ARCH_TMS320C64X, CS_MODE_BIG_ENDIAN },
{ "tms320c64xle", CS_ARCH_TMS320C64X, CS_MODE_LITTLE_ENDIAN },
{ "m6800", CS_ARCH_M680X, CS_MODE_M680X_6800 },
{ "m6801", CS_ARCH_M680X, CS_MODE_M680X_6801 },
{ "m6805", CS_ARCH_M680X, CS_MODE_M680X_6805 },
Expand Down
8 changes: 8 additions & 0 deletions suite/cstest/issues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,3 +1066,11 @@
!# issue 2424
!# CS_ARCH_SH, CS_MODE_SH2A | CS_MODE_BIG_ENDIAN, CS_OPT_DETAIL
0x0: 0x32,0x11,0x92,0x00 == movu.w @(1024,r1),r2 ; operands[0].type: MEM ; operands[0].mem.reg: REG = r1 ; operands[0].mem.disp: 0x400 ; address mode: Register Indirect with Predecrement ; operands[1].type: REG = r2

!# issue 2646
!# CS_ARCH_TMS320C64X, CS_MODE_LITTLE_ENDIAN, CS_OPT_DETAIL
0x0: 0xa9,0xff,0x7f,0x02 == mvk.S1 -1, a4 ||

!# issue 2646
!# CS_ARCH_TMS320C64X, CS_MODE_BIG_ENDIAN, CS_OPT_DETAIL
0x0: 0x02,0x7f,0xff,0xa9 == mvk.S1 -1, a4 ||
Loading