beardypig / ghidra-emotionengine

Ghidra Processor for the Play Station 2's Emotion Engine MIPS based CPU
Apache License 2.0
200 stars 34 forks source link

Signed value displayed in unsigned instruction #53

Closed Tupelov closed 3 years ago

Tupelov commented 3 years ago

addiu Uses an unsigned value. image It should display: addiu v0,v0 0xfd80 addiu v1,v1, 0xe330

astrelsky commented 3 years ago

Nice catch. May you change simmed to immed in mips.sinc on lines 24 and 25, change sext to zext on line 26, and then submit a pull request please? I'm on my phone and this is a simple fix that you should get credit for.

If you may also fix the li and addu instructions as well it would be appreciated. They are right below addiu.

Tupelov commented 3 years ago

I'll try checking it out, hopefully I don't need a Java IDE setup

Tupelov commented 3 years ago

Seems like this issue also affects a bunch of other immediate unsigned instructions as well, I'll try to fix those as well

Tupelov commented 3 years ago

Yeah looks like that fixed it. image I'll be submitting my fixes as a pr soon

Tupelov commented 3 years ago

Closed #55

JayFoxRox commented 3 years ago

addiu Uses an unsigned value.

This is incorrect and a broken assumption for #55.

The only difference to addi is that it shouldn't cause overflow exceptions. Otherwise it's exactly the same. There's plenty of literature on the topic, but https://webdocs.cs.ualberta.ca/~amaral/courses/229/F04/webslides/Topic6-Logic/tsld005.htm is a good summary.