esaulenka / ghidra_v850

Ghidra support for Renesas V850 MCUs
MIT License
60 stars 25 forks source link

Cannot disassemble "e0bf 5284" and "e05f 5294". #27

Closed ikuyas closed 1 year ago

ikuyas commented 1 year ago

Ghidra cannot disassemble "e0bf 5284" and "e05f 5294". They shoud be "cvtf.wd r23r24, r16r17" and "cvtf.wd r11r12, r18r19". Ghidra CAN disassemble "e087 5274" as "cvtf.wd r16r17, r14r15". I could not find a bug in code.

esaulenka commented 1 year ago

I dont remember, how cvtf encoded, but usually instructions which working with 'wide' registers can use only register pairs starting from even number. I.e. r23r24 pair cannot be used, only r22r23 and r24r25.

Where you got your example, it is a correct code?..

ikuyas commented 1 year ago

The code is actual code. cvtf.wd is a converting operation from word to double word. "e0bf 5284" and "e05f 5294" should be "cvtf.wd r23, r16r17" and "cvtf.wd r11, r18r19". I was misunderstanding. So I think that cvtf.wd definition uses R1115 instead of R1115odd.

esaulenka commented 1 year ago

you are right, according to this reg1 just a single register, not a pair