Add support for NEC uPD78 micro-controllers

8-bit micro-controllers with skip-next-if style branching.
This commit is contained in:
Vesa-Pekka Palmu 2020-02-03 21:45:41 +02:00
parent 92a1c0dccf
commit fe3783f4ec
9 changed files with 1706 additions and 0 deletions

View File

@ -0,0 +1,8 @@
Ghidra software is released under the Apache 2.0 license. In addition,
there are numerous 3rd party components that each have their
own license. The license file for each of these licenses can be found
in the licenses directory in the installation root directory.
The 3rd party files in this module are as follows:
languages/* Licensed under Apache 2.0 license by Vesa-Pekka Palmu

View File

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
+ Compile sleigh languages within this distribution language module via Eclipse or
+ a command shell.
+
+ * Eclipse: right-click on this file and choose menu item "Run As->Ant Build"
+
+ * From command line (requires ant install)
+ - cd to data directory containing this file
+ - run ant
+
+ Sleigh compiler options are read from sleighArgs.txt.
-->
<project name="privateBuildDistribution" default="sleigh-compile">
<property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>
<target name="sleigh-compile">
<property name="framework.path" value="../../../Framework"/>
<path id="sleigh.class.path">
<fileset dir="${framework.path}/SoftwareModeling/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${framework.path}/Generic/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${framework.path}/Utility/lib">
<include name="*.jar"/>
</fileset>
</path>
<available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>
<fail unless="sleigh.compile.exists" />
<java classname="${sleigh.compile.class}"
classpathref="sleigh.class.path"
fork="true"
failonerror="true">
<jvmarg value="-Xmx2048M"/>
<arg value="-DBaseDir=../../../../../" /> <!-- Ghidra install directory -->
<arg value="-i"/>
<arg value="sleighArgs.txt"/>
<arg value="-a"/>
<arg value="./languages"/>
</java>
</target>
</project>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<compiler_spec>
<global>
<range space="ram"/>
</global>
<stackpointer register="SP" space="ram" growth="negative"/>
<default_proto>
<prototype name="__stdcall" extrapop="-2" stackshift="-2">
<input>
<pentry minsize="1" maxsize="1">
<register name="A"/>
</pentry>
<pentry minsize="1" maxsize="1">
<register name="B"/>
</pentry>
</input>
<output>
<pentry minsize="1" maxsize="1">
<register name="A"/>
</pentry>
<pentry minsize="2" maxsize="2">
<register name="EA"/>
</pentry>
</output>
<unaffected>
<register name="SP"/>
</unaffected>
</prototype>
</default_proto>
</compiler_spec>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<language_definitions>
<language processor="upd78"
endian="little"
size="16"
variant="default"
version="1.0"
slafile="upd78.sla"
processorspec="upd78.pspec"
id="upd78:LE:16:default">
<description>NEC uPD78</description>
<compiler name="default" spec="upd78.cspec" id="default"/>
</language>
</language_definitions>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<processor_spec>
<programcounter register="PC"/>
<context_data>
<tracked_set space="ram">
<set name="PSW" val="0"/>
</tracked_set>
</context_data>
<register_data>
<register name="PSW" group="Flags"/>
<register name="VA_" group="Alt"/>
<register name="BC_" group="Alt"/>
<register name="DE_" group="Alt"/>
<register name="HL_" group="Alt"/>
<register name="EA_" group="Alt"/>
</register_data>
<default_symbols>
<symbol name="RST0" address="ram:0000" entry="true"/>
<symbol name="NMI" address="ram:0004" entry="false"/>
<symbol name="INTT0_INTT1" address="ram:0008" entry="false"/>
<symbol name="INT1_INT2" address="ram:0010" entry="false"/>
<symbol name="INTE0_INTE1" address="ram:0018" entry="false"/>
<symbol name="INTEIN_INTAD" address="ram:0020" entry="false"/>
<symbol name="INTSR_INTST" address="ram:0028" entry="false"/>
<symbol name="SOFTI" address="ram:0060" entry="false"/>
<symbol name="CALL_TABLE" address="ram:0080" entry="false"/>
</default_symbols>
</processor_spec>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
-t