[HCS12] fix memory mapping local -> physical #7261
Open
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.
There are a few commits to improve HSC12 decompilation.
first one is just cosmetic changes, removed a few spaces to align similar lines into one column. If you want, I can remove this commitit (as I know, such 'useless' changes are not much appreciated)
Local addresses 0..0x3fff had a reference to flash page 3D, which is wrong.
AN3784 "Understanding the Memory Scheme in the S12(X) Architecture" (as well as datasheets for particular MC9S12xxxx chips) says that the first quarter of the local memory should point to the IO area, RAM and EEPROM.
there is the issue with reading data relative to PC register. In particular I found that
JMP [D,PC]
reads the jump address from some weird location, while typically these addresses located immediately after it. I'm not sure about the other PC-related operands, but perhaps it also broken.