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

c166 audit #2

Merged
merged 1 commit into from
Apr 24, 2020
Merged

c166 audit #2

merged 1 commit into from
Apr 24, 2020

Conversation

mumbel
Copy link
Contributor

@mumbel mumbel commented Apr 18, 2020

Hopefully this fixes more than breaks, feel free take lines of code from this
branch if the PR is too much, no problem about attribution if this is the case

Looks like a rewrite, but mostly due to variable re-naming to get
a better idea of how things align with the manual

Added comments for the instruction display and byte sequence

Added ESPR and SPR registers to pspec and better handled in slaspec
which cleaned up the 8-bit addressing code

Added DWARF mapping just cause I had that document out reading up on (E)SPR
Still need to add to the ldef if it looks good and you want to include it

Minor bug fixes in display section (shouldnt affect analysis, just readability)

Minor bug fixes in a few table constructors ('mem' change should be noticeable)

Cleaned up access to IP, previously the high byte could get cut off

Cleaned up SP access, previously used 'Stack' variable instead of SP
This might need revisiting (how are all the different stacks setup?)

ATTN I did probably break signed a lot since the 2's complement description
vs the supplied data didn't make sense to me (how #dataN work)
but since you have flag tracking so well, it should/might pick up that
detail in the decompiler

Hopefully this fixes more than breaks, feel free take lines of code from this
branch if the PR is too much, no problem about attribution if this is the case

Looks like a rewrite, but mostly due to variable re-naming to get
a better idea of how things align with the manual

Added comments for the instruction display and byte sequence

Added ESPR and SPR registers to pspec and better handled in slaspec
which cleaned up the 8-bit addressing code

Added DWARF mapping just cause I had that document out reading up on (E)SPR
Still need to add to the ldef if it looks good and you want to include it

Minor bug fixes in display section (shouldnt affect analysis, just readability)

Minor bug fixes in a few table constructors ('mem' change should be noticeable)

Cleaned up access to IP, previously the high byte could get cut off

Cleaned up SP access, previously used 'Stack' variable instead of SP
This might need revisiting (how are all the different stacks setup?)

ATTN  I did probably break signed a lot since the 2's complement description
      vs the supplied data didn't make sense to me (how #dataN work)
      but since you have flag tracking so well, it should/might pick up that
      detail in the decompiler
@esaulenka esaulenka merged commit d0637b7 into esaulenka:master Apr 24, 2020
@esaulenka
Copy link
Owner

Great job, thanks!
Sorry for delay. Right now I only have access to small laptop, which makes harder to work with ghidra. And I dont know, how long it will be last...

Looks like memory access works much better, thanks!

I will record found errors to issues page of this repo, if you dont mind.

ATTN I did probably break signed a lot

please explain in more detail, what do you means

@mumbel
Copy link
Contributor Author

mumbel commented Apr 24, 2020

No problem on the delay, hope all is well. That's unfortunate about only having a tiny laptop.

You had previously used tokens that were signed for some of the #dataX. I did not have them signed as the description of the #dataX made them sound like zero-extended only. I might have misunderstood this part.

But then (since it makes sense to use signed in them) the instructions describe themselves as doing 2's complement math. This may still be the case currently since you are calculating flags. I guess I need to go through the binary to find a couple of good use cases of negative numbers before this merge and see how my changes have effected them

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 this pull request may close these issues.

2 participants