esaulenka / ghidra_v850

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

the register "cdbcr" is missing #24

Closed ikuyas closed 1 year ago

ikuyas commented 1 year ago

Ghidra can not disassemble the code "f867 4068". The code is disassembled to "stsr cdbcr, r12,13". I add the following 4 definitions (a,b,c,d) in v850e3.sinc and 2 definitions (e,f) in v850_common.sinc.

a) at the last of the secction "define register offset=0x104 size=4[]"

     # selID = 13
     _ _ _ _ _ _ _ _
     _ _ _ _ _ _ _ _
     _ _ _ _ _ _ _ _
     cdbcr _ _ _ _ _ _ _

b) at the last of the secction "# More special registers"

attach variables [ SR0004_d SR1115_d ] [
    _ _ _ _ _ _ _ _
    _ _ _ _ _ _ _ _
    _ _ _ _ _ _ _ _
    cdbcr _ _ _ _ _ _ _
];

c) in the section # STSR regID, reg2, selId :stsr SR0004_d, R1115, 13 is op0510=0x3F & R1115 & SR0004_d; op1626=0x40 & op2731=0x0d { R1115 = SR0004_d; } d) in the section # LDSR reg2, regID, selId :ldsr R0004, SR1115_d, 13 is op0510=0x3F & SR1115_d & R0004; op1626=0x20 & op2731=0x0d { SR1115_d = R0004; } e) SR0004_d = (0,4) f) SR1115_d = (11,15)