Skip to content
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

M68K: invalid transfer direction in MOVEC instruction #1661

Closed
maximumspatium opened this issue Jul 15, 2020 · 1 comment
Closed

M68K: invalid transfer direction in MOVEC instruction #1661

maximumspatium opened this issue Jul 15, 2020 · 1 comment

Comments

@maximumspatium
Copy link
Contributor

maximumspatium commented Jul 15, 2020

When disassembling some 68k code, I noticed that the disassembly for the MOVEC instruction produced by the Capstone engine is wrong.

Expected output:

0x4E7A 0002 MOVEC CACR, D0

Capstone output (wrong):

0x4E7A 0002 MOVEC D0, CACR

A short peek into the corresponding source revealed the following buggy code:
https://github.com/aquynh/capstone/blob/0dc008920f8345274b4a596f9a1bbe703d083123/arch/M68K/M68KDisassembler.c#L2623

The above code checks bit 1 of the instruction opcode, but it should be actually bit 0 as described in the Motorola manual:

M68k MOVEC direction

I'll send a PR in short.

@maximumspatium
Copy link
Contributor Author

Fixed in #1663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant