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
Fixes two issues with address calculation:
Fix absolute address calculations.
Absolute effective addresses are decoded by DecodeBInstruction().
Because they are encoded as normal disp24 value.
To form the EA:
The lower 20bits are shifted by one, and the upper 4bits by 1 (jumps) or 7 (calls).
Fix PC relative disponents.
The ISA sign extends disponents values of 8, 15 and 24 bits.
For address disponents it also shifts the results by 1 for alignment.
The ISA has two writing styles for this though:
sign_ext(dispXX * 2) and sign_ext(dispXX) * 2.
Assuming that sign_ext() always works on the MSB of the value
they are eqivalent. Because:
sign_ext(disp8 * 2) = sign_ext(disp8 * 2 = disp9) = sign_ext(disp9) = sign_ext(disp8) * 2.
This let to confusion before and for the sign_ext(dispXX * 2) case,
and the wrong bit was checked for sign extension (e.g bit 8 for an effective disp9 value).
Test plan
Not yet added.
Closing issues
...