nihilus / snowman

Snowman decompiler
http://derevenets.com/
105 stars 15 forks source link

After adding hlide's improved AST generation I get lots of errors. #32

Closed nihilus closed 9 years ago

nihilus commented 9 years ago

@hlide if you check my latest trunk and then run "nocode/nocode --verbose auto_wan_pt" it will yield the following errors.

Warning] Invalid instruction `bal 0x400a14' at 0x400a0c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x400a2c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `bal 0x400a44' at 0x400a3c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x400a5c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `bal 0x400a8c' at 0x400a84: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x400acc: The instruction does not have an argument with index 0
[Warning] Invalid instruction `b 0x400ad4' at 0x400ad4: There is no operand 0.
[Warning] Invalid instruction `beqz $v0, 0x400b38' at 0x400b0c: The instruction does not have an argument with index 1
[Warning] Invalid instruction `b 0x400ba0' at 0x400b14: There is no operand 0.
[Warning] Invalid instruction `jalr $t9' at 0x400b80: The instruction does not have an argument with index 0
[Warning] Invalid instruction `beqz $v0, 0x400c04' at 0x400be4: The instruction does not have an argument with index 1
[Warning] Invalid instruction `jalr $t9' at 0x400bf4: The instruction does not have an argument with index 0
[Warning] Invalid instruction `beqz $v0, 0x400c4c' at 0x400c18: The instruction does not have an argument with index 1
[Warning] Invalid instruction `beqz $v0, 0x400c4c' at 0x400c30: The instruction does not have an argument with index 1
[Warning] Invalid instruction `jalr $t9' at 0x400c40: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x400cc4: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x400d28: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x400dbc: The instruction does not have an argument with index 0
[Warning] Invalid instruction `beqz $v0, 0x400e14' at 0x400dc8: The instruction does not have an argument with index 1
[Warning] Invalid instruction `bnez $v1, 0x400d88' at 0x400df0: The instruction does not have an argument with index 1
[Warning] Invalid instruction `jalr $t9' at 0x400e9c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `beqz $v0, 0x400ef4' at 0x400ea8: The instruction does not have an argument with index 1
[Warning] Invalid instruction `bnez $v1, 0x400e68' at 0x400ed0: The instruction does not have an argument with index 1
[Warning] Invalid instruction `jalr $t9' at 0x400f8c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x401014: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x401500: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x401638: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x4016e4: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x40173c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `bnez $v0, 0x4019cc' at 0x401838: The instruction does not have an argument with index 1
[Warning] Invalid instruction `bnez $v0, 0x401a30' at 0x401888: The instruction does not have an argument with index 1
[Warning] Invalid instruction `jalr $t9' at 0x401898: The instruction does not have an argument with index 0
[Warning] Invalid instruction `beq $v1, $v0, 0x401948' at 0x4018b0: The instruction does not have an argument with index 2
[Warning] Invalid instruction `jalr $t9' at 0x401914: The instruction does not have an argument with index 0
[Warning] Invalid instruction `bnez $v0, 0x401a30' at 0x401990: The instruction does not have an argument with index 1
[Warning] Invalid instruction `jalr $t9' at 0x4019a0: The instruction does not have an argument with index 0
[Warning] Invalid instruction `bnez $v0, 0x4018b8' at 0x4019ac: The instruction does not have an argument with index 1
[Warning] Invalid instruction `b 0x401840' at 0x4019e4: There is no operand 0.
[Warning] Invalid instruction `jalr $t9' at 0x401aac: The instruction does not have an argument with index 0
[Warning] Invalid instruction `bal 0x401c84' at 0x401c7c: The instruction does not have an argument with index 0
[Warning] Invalid instruction `jalr $t9' at 0x401c9c: The instruction does not have an argument with index 0
nihilus commented 9 years ago

Seems like the detail_ pointer doesn't get updated correctly.

hlide commented 9 years ago

ah yeah, that was an issue I had in early version of Allegrex architecture, you need to save it before handling delay slot instruction and restore it afterward if you need to access this _detail__ member again for the branch instruction.

nihilus commented 9 years ago

Ah... Thx. Yes you are correct... Since the delays slot is evaluated before the branch instruction the branch instruction will deal with the result from the delay slot, which might be an NOP in many cases.

nihilus commented 9 years ago

Fixed in commit 8f09df15979ce5fccf5aa970dd0e24441c311518