Ghidra is a software reverse engineering (SRE) framework
Added Files for builder subsystem + little bugfixes
Aleckaj5e660b8d9d7a
diff --git a/Ghidra/Processors/V850E2M/build.gradle b/Ghidra/Processors/V850E2M/build.gradlenew file mode 100644index 0000000000..2e8e16e958--- /dev/null+++ b/Ghidra/Processors/V850E2M/build.gradle@@ -0,0 +1,4 @@+apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"+apply from: "$rootProject.projectDir/gradle/processorProject.gradle"+apply plugin: 'eclipse'+eclipse.project.name = 'Processors v850'\ No newline at end of filediff --git a/Ghidra/Processors/V850E2M/certification.manifest b/Ghidra/Processors/V850E2M/certification.manifestnew file mode 100644index 0000000000..6234d7435a--- /dev/null+++ b/Ghidra/Processors/V850E2M/certification.manifest@@ -0,0 +1,30 @@+##VERSION: 2.0+Module.manifest||GHIDRA||||END|+build.gradle||GHIDRA||||END|+data/languages/V850E2M.cspec||GHIDRA||||END|+data/languages/V850E2M.ldefs||GHIDRA||||END|+data/languages/V850E2M.pspec||GHIDRA||||END|+data/languages/V850E2M.slaspec||GHIDRA||||END|+data/languages/Helpers/Conditions.sinc||GHIDRA||||END|+data/languages/Helpers/Extras.sinc||GHIDRA||||END|+data/languages/Helpers/Macros.sinc||GHIDRA||||END|+data/languages/Helpers/Register.sinc||GHIDRA||||END|+data/languages/Helpers/Tokens.sinc||GHIDRA||||END|+data/languages/Helpers/Variables.sinc||GHIDRA||||END|+data/languages/Instructions/Arithmetic.sinc||GHIDRA||||END|+data/languages/Instructions/BitSearch.sinc||GHIDRA||||END|+data/languages/Instructions/BitManipulation.sinc||GHIDRA||||END|+data/languages/Instructions/Branch.sinc||GHIDRA||||END|+data/languages/Instructions/Conditional.sinc||GHIDRA||||END|+data/languages/Instructions/DataManipulation.sinc||GHIDRA||||END|+data/languages/Instructions/Divide.sinc||GHIDRA||||END|+data/languages/Instructions/Float.sinc||GHIDRA||||END|+data/languages/Instructions/HighSpeedDivide.sinc||GHIDRA||||END|+data/languages/Instructions/Load.sinc||GHIDRA||||END|+data/languages/Instructions/Logic.sinc||GHIDRA||||END|+data/languages/Instructions/Multiply.sinc||GHIDRA||||END|+data/languages/Instructions/MultiplyAccumulate.sinc||GHIDRA||||END|+data/languages/Instructions/Saturated.sinc||GHIDRA||||END|+data/languages/Instructions/Special.sinc||GHIDRA||||END|+data/languages/Instructions/Store.sinc||GHIDRA||||END|+data/manuals/v850.idx||GHIDRA||||END|\ No newline at end of filediff --git a/Ghidra/Processors/V850E2M/data/languages/Helpers/Conditions.sinc b/Ghidra/Processors/V850E2M/data/languages/Helpers/Conditions.sincindex d2c7500347..16ba1a09b2 100644--- a/Ghidra/Processors/V850E2M/data/languages/Helpers/Conditions.sinc+++ b/Ghidra/Processors/V850E2M/data/languages/Helpers/Conditions.sinc@@ -3,36 +3,36 @@#####################################################-c0003: "V" is op0003=0x0 { tmp:1 = ($(OV)) == 1; export tmp; }-c0003: "NV" is op0003=0x8 { tmp:1 = ($(OV)) == 0; export tmp; }-c0003: "C_L" is op0003=0x1 { tmp:1 = ($(CY)) == 1; export tmp; }-c0003: "NC_L" is op0003=0x9 { tmp:1 = ($(CY)) == 0; export tmp; }-c0003: "Z" is op0003=0x2 { tmp:1 = ($(Z)) == 1; export tmp; }-c0003: "NZ" is op0003=0xA { tmp:1 = ($(Z)) == 0; export tmp; }-c0003: "NH" is op0003=0x3 { tmp:1 = ($(CY) || $(Z)) == 1; export tmp; }-c0003: "H" is op0003=0xB { tmp:1 = ($(CY) || $(Z)) == 0; export tmp; }-c0003: "S_N" is op0003=0x4 { tmp:1 = ($(S)) == 1; export tmp; }-c0003: "NS_P" is op0003=0xC { tmp:1 = ($(S)) == 0; export tmp; }-c0003: "T" is op0003=0x5 { tmp:1 = 1; export tmp; }-c0003: "SA" is op0003=0xD { tmp:1 = ($(SAT)) == 1; export tmp; }-c0003: "LT" is op0003=0x6 { tmp:1 = ($(S) ^^ $(OV)) == 1; export tmp; }-c0003: "GE" is op0003=0xE { tmp:1 = ($(S) ^^ $(OV)) == 0; export tmp; }-c0003: "LE" is op0003=0x7 { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 1; export tmp; }-c0003: "GT" is op0003=0xF { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 0; export tmp; }+c0003: "v" is op0003=0x0 { tmp:1 = ($(OV)) == 1; export tmp; }+c0003: "nv" is op0003=0x8 { tmp:1 = ($(OV)) == 0; export tmp; }+c0003: "c" is op0003=0x1 { tmp:1 = ($(CY)) == 1; export tmp; }+c0003: "nc" is op0003=0x9 { tmp:1 = ($(CY)) == 0; export tmp; }+c0003: "e" is op0003=0x2 { tmp:1 = ($(Z)) == 1; export tmp; }+c0003: "ne" is op0003=0xA { tmp:1 = ($(Z)) == 0; export tmp; }+c0003: "nh" is op0003=0x3 { tmp:1 = ($(CY) || $(Z)) == 1; export tmp; }+c0003: "h" is op0003=0xB { tmp:1 = ($(CY) || $(Z)) == 0; export tmp; }+c0003: "n" is op0003=0x4 { tmp:1 = ($(S)) == 1; export tmp; }+c0003: "p" is op0003=0xC { tmp:1 = ($(S)) == 0; export tmp; }+c0003: "r" is op0003=0x5 { tmp:1 = 1; export tmp; }+c0003: "sa" is op0003=0xD { tmp:1 = ($(SAT)) == 1; export tmp; }+c0003: "lt" is op0003=0x6 { tmp:1 = ($(S) ^^ $(OV)) == 1; export tmp; }+c0003: "ge" is op0003=0xE { tmp:1 = ($(S) ^^ $(OV)) == 0; export tmp; }+c0003: "le" is op0003=0x7 { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 1; export tmp; }+c0003: "gt" is op0003=0xF { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 0; export tmp; }-c1720: "V" is op1720=0x0 { tmp:1 = ($(OV)) == 1; export tmp; }-c1720: "NV" is op1720=0x8 { tmp:1 = ($(OV)) == 0; export tmp; }-c1720: "C_L" is op1720=0x1 { tmp:1 = ($(CY)) == 1; export tmp; }-c1720: "NC_NL" is op1720=0x9 { tmp:1 = ($(CY)) == 0; export tmp; }-c1720: "Z" is op1720=0x2 { tmp:1 = ($(Z)) == 1; export tmp; }-c1720: "NZ" is op1720=0xA { tmp:1 = ($(Z)) == 0; export tmp; }-c1720: "NH" is op1720=0x3 { tmp:1 = ($(CY) || $(Z)) == 1; export tmp; }-c1720: "H" is op1720=0xB { tmp:1 = ($(CY) || $(Z)) == 0; export tmp; }-c1720: "S_N" is op1720=0x4 { tmp:1 = ($(S)) == 1; export tmp; }-c1720: "NS_P" is op1720=0xC { tmp:1 = ($(S)) == 0; export tmp; }-c1720: "T" is op1720=0x5 { tmp:1 = 1; export tmp; }-c1720: "SA" is op1720=0xD { tmp:1 = ($(SAT)) == 1; export tmp; }-c1720: "LT" is op1720=0x6 { tmp:1 = ($(S) ^^ $(OV)) == 1; export tmp; }-c1720: "GE" is op1720=0xE { tmp:1 = ($(S) ^^ $(OV)) == 0; export tmp; }-c1720: "LE" is op1720=0x7 { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 1; export tmp; }-c1720: "GT" is op1720=0xF { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 0; export tmp; }\ No newline at end of file+c1720: "v" is op1720=0x0 { tmp:1 = ($(OV)) == 1; export tmp; }+c1720: "nv" is op1720=0x8 { tmp:1 = ($(OV)) == 0; export tmp; }+c1720: "c" is op1720=0x1 { tmp:1 = ($(CY)) == 1; export tmp; }+c1720: "nc" is op1720=0x9 { tmp:1 = ($(CY)) == 0; export tmp; }+c1720: "e" is op1720=0x2 { tmp:1 = ($(Z)) == 1; export tmp; }+c1720: "ne" is op1720=0xA { tmp:1 = ($(Z)) == 0; export tmp; }+c1720: "nh" is op1720=0x3 { tmp:1 = ($(CY) || $(Z)) == 1; export tmp; }+c1720: "h" is op1720=0xB { tmp:1 = ($(CY) || $(Z)) == 0; export tmp; }+c1720: "n" is op1720=0x4 { tmp:1 = ($(S)) == 1; export tmp; }+c1720: "p" is op1720=0xC { tmp:1 = ($(S)) == 0; export tmp; }+c1720: "r" is op1720=0x5 { tmp:1 = 1; export tmp; }+c1720: "sa" is op1720=0xD { tmp:1 = ($(SAT)) == 1; export tmp; }+c1720: "lt" is op1720=0x6 { tmp:1 = ($(S) ^^ $(OV)) == 1; export tmp; }+c1720: "ge" is op1720=0xE { tmp:1 = ($(S) ^^ $(OV)) == 0; export tmp; }+c1720: "le" is op1720=0x7 { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 1; export tmp; }+c1720: "gt" is op1720=0xF { tmp:1 = ($(S) ^^ $(OV) || $(Z)) == 0; export tmp; }\ No newline at end of filediff --git a/Ghidra/Processors/V850E2M/data/languages/Helpers/Variables.sinc b/Ghidra/Processors/V850E2M/data/languages/Helpers/Variables.sincindex b917966a23..6bb7bb96a0 100644--- a/Ghidra/Processors/V850E2M/data/languages/Helpers/Variables.sinc+++ b/Ghidra/Processors/V850E2M/data/languages/Helpers/Variables.sinc@@ -41,7 +41,7 @@ attach variables [op1_1720] [r1 sp tp r7 r9 r11 r13 r15 r17 r19 r21 r23 r25 r27attach names [fcond2730]-["F" "UN" "EQ" "UEQ" "OLT" "ULT" "OLE" "ULE" "SF" "NGLE" "SEQ" "NGL" "LT" "NGE" "LE" "NGT"];+["f" "un" "eq" "ueq" "olt" "ult" "ole" "ule" "sd" "ngle" "seq" "ngl" "lt" "nge" "le" "ngt"];@define NP "PSW[7,1]"diff --git a/Ghidra/Processors/V850E2M/data/languages/Instructions/Branch.sinc b/Ghidra/Processors/V850E2M/data/languages/Instructions/Branch.sincindex ea9a02682c..7a7d1b4698 100644--- a/Ghidra/Processors/V850E2M/data/languages/Instructions/Branch.sinc+++ b/Ghidra/Processors/V850E2M/data/languages/Instructions/Branch.sinc@@ -31,11 +31,16 @@}# JMP [reg1] - 00000000011RRRRR-:jmp [R0004] is op0515=0x003 & R0004 & op0004=0x1F+:jmp [R0004] is op0515=0x03 & R0004 & op0004=0x1F{PC = R0004;return [R0004];}+:jmp [R0004] is op0515=0x03 & R0004 & op0004!=0x1F+{+ PC = R0004;+ call [R0004];+}# JMP disp32[reg1] - 00000110111RRRRR|ddddddddddddddd0|DDDDDDDDDDDDDDDD:jmp adr32[R0004] is op0515=0x037 & R0004; adr32