Ghidra_C166 icon indicating copy to clipboard operation
Ghidra_C166 copied to clipboard

Severe instruction decoding bug

Open Elmue opened this issue 3 years ago • 0 comments

There is something very wrong in the slaspec file.

The following code has been decoded correctly by IDA pro

F7 F0 B0 FE    movb    S0TBUF, rL0
and
F3 F0 B2 FE    movb    rL0, S0RBUF

The special function register FEB0 is ASC0_TBUF or S0TBUF (depending on which Infineon manual you use) The special function register FEB2 is ASC0_RBUF or S0RBUF (depending on which Infineon manual you use)

But what Ghidra decodes is completely wrong:

f7 f0 b0 fe     movb       0x3eb0, RL0
and
f3 f0 b2 fe     movb       RL0, 0x3eb2

FEB0 is wrongly converted to 3EB0 FEB2 is wrongly converted to 3EB2

Also wrong:

All the following:
f7 f0 04 81     movb       0x0104,RL0
f7 f0 04 91     movb       0x4104,RL0
f7 f0 04 a1     movb       0x8104,RL0
f7 f0 04 c1     movb       0xC104,RL0
are displayed as if they were the same instruction:
f7 f0 04 x1     movb       0x104,RL0

Elmue avatar Feb 23 '21 17:02 Elmue