Skip to content

M68K: invalid transfer direction in MOVEC instruction #1661

@maximumspatium

Description

@maximumspatium

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions