M68K: fix displacement, register naming and suppressed registers #2839
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Your checklist for this pull request
Detailed description
There were several issues with the M68K disassembler and instruction printer.
Integer displacements were generally printed as unsigned integers, while they are signed in the architecture. This was mainly due to the 16 bit displacement not being sign extended by the disassembler, and the printer not handling negative displacements. The
m68k_op_mem.in_dispand.out_dispfields have been changed toint32_t. Please note that this will require updating contrib/objdump/objdump-m68k.py, which currently does a fair bit of two's complement wrangling. It looks like it can be simplified greatly after updating the fields' types, but I am not comfortable with doing that.The M68K_AM_PCI_INDEX_BASE_DISP addressing mode was not disassembled correctly.
There were several issues with suppressed index registers (which printed as "invalid") and the PC register (which printed as "a16") in the instruction printer.
All in all, this pull request has the following effects:
Test plan
All existing tests pass, and tests covering the table above have been added to tests/details/m68k.yaml.