Skip to content

TMS32c64x gives different assembly text if details are enabled #2650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Rot127 opened this issue Mar 20, 2025 · 2 comments
Open

TMS32c64x gives different assembly text if details are enabled #2650

Rot127 opened this issue Mar 20, 2025 · 2 comments
Labels
bug Something is not working as it should TMS320C64x Arch

Comments

@Rot127
Copy link
Collaborator

Rot127 commented Mar 20, 2025

Work environment

Questions Answers
System Capstone runs on OS/arch/bits All
Capstone module affected tms32oc64x
Source of Capstone git clone
Version/git commit v5, v6

Instruction bytes giving faulty results

0x02,0x7f,0xff,0xa9 (big endian)

Expected results

It should be either:

mvk.S1 -1, a4 ||

or

mvk -1, a4

But it must be consistent.

Steps to get the wrong result

With cstool:

cstool tms320c64x -d 0x02,0x7f,0xff,0xa9
cstool tms320c64x 0x02,0x7f,0xff,0xa9

Additional Logs, screenshots, source code, configuration dump, ...

The TMS320C64x_post_printer() changes the assembly text if the details are enabled. Which doesn't make sense, because it should also fix up the text if it isn't enabled.

@Rot127 Rot127 added bug Something is not working as it should TMS320C64x Arch labels Mar 20, 2025
@Rot127
Copy link
Collaborator Author

Rot127 commented Apr 2, 2025

cc @trufae
To quote:

you can read more about this in the TI doc https://www.ti.com/lit/ug/spru732j/spru732j.pdf

what re those details /without details disasm difference? i mean, the || means the instruction will be executed in parallel with the previous or following instruction.

The p-bit (bit 0) determines whether the instruction executes in parallel with another instruction.

So what ever it does now is not correct. Will look at it after the Alpha4 patch release, since it takes a little more effort to be don properly.

@trufae
Copy link
Contributor

trufae commented Apr 2, 2025

Thanks for the effort! I plan to meanwhile integrate the gnu disassembler so it can be used to compare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as it should TMS320C64x Arch
Projects
None yet
Development

No branches or pull requests

2 participants