matt-kempster / m2c

A MIPS and PowerPC decompiler.
GNU General Public License v3.0
386 stars 46 forks source link

PPC instruction stwu not parsing: maybe related to negative numbers #241

Closed fraser125 closed 1 year ago

fraser125 commented 1 year ago

Originally found using decomp.me but reproduced at https://simonsoftware.se/other/m2c.html Code line

/* 803FA8CC  94 21 FF F0 */ stwu r1, -0x10(r1)

Decompilation failure: Failed to parse instruction at stdin line 3: stwu r1, -0x10(r1)

Error: operand out of range (0x000000000000ffff is not between 0xffffffffffff8000 and 0x00000000000007fff)

image

simonlindholm commented 1 year ago

I can't reproduce this error. If I put just /* 803FA8CC 94 21 FF F0 */ stwu r1, -0x10(r1) in the textarea at https://simonsoftware.se/other/m2c.html and set target arch to PPC I get a successful decompile.

fraser125 commented 1 year ago

I didn't set the target (I forgot) so it works now for me on m2c, I'll see what I can find out about how decomp.me is doing their side. Thanks!