From aa1e594519e833ada2eb2ed4c5376605616f08ff Mon Sep 17 00:00:00 2001 From: "Edward J. Schwartz" Date: Wed, 5 Apr 2023 14:14:15 -0400 Subject: [PATCH 1/2] Fix tas instruction for coldfire Does not apply to modes 0 or 1 --- Ghidra/Processors/68000/data/languages/68000.sinc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/Processors/68000/data/languages/68000.sinc b/Ghidra/Processors/68000/data/languages/68000.sinc index b986105bed..97212edff1 100644 --- a/Ghidra/Processors/68000/data/languages/68000.sinc +++ b/Ghidra/Processors/68000/data/languages/68000.sinc @@ -1997,7 +1997,7 @@ ptestLevel: "#"^mregn is mregn { export *[const]:1 mregn; } :tst.l eal is (opbig=0x4a & op67=2)... & eal { logflags(); resflags(eal); } @ifdef COLDFIRE -:tas eab is (opbig=0x4a & op67=3)... & eab { logflags(); resflags(eab); eab = eab | 0x80; } +:tas eab is (opbig=0x4a & op67=3 & $(MEM_ALTER_ADDR_MODES))... & eab { logflags(); resflags(eab); eab = eab | 0x80; } @endif # COLDFIRE :unlk regan is opbig=0x4e & op37=11 & regan { SP = regan; regan = *SP; SP = SP+4; } From 9c7de2e69ede0ed636171b6601bb8324c6cea4ce Mon Sep 17 00:00:00 2001 From: "Edward J. Schwartz" Date: Wed, 5 Apr 2023 14:37:04 -0400 Subject: [PATCH 2/2] Add coldfire halt instruction --- Ghidra/Processors/68000/data/languages/68000.sinc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Ghidra/Processors/68000/data/languages/68000.sinc b/Ghidra/Processors/68000/data/languages/68000.sinc index 97212edff1..2fff21e3f4 100644 --- a/Ghidra/Processors/68000/data/languages/68000.sinc +++ b/Ghidra/Processors/68000/data/languages/68000.sinc @@ -1290,6 +1290,10 @@ subdiv: regdr:regdq is regdq & regdr & divsz=1 & divsgn=1 { divi:8 = (sext(r :ext.l regdn is op=4 & reg9dn=4 & op68=3 & op35=0 & regdn { local tmp =regdn:2; regdn = sext(tmp); } :extb.l regdn is op=4 & reg9dn=4 & op68=7 & op35=0 & regdn { local tmp =regdn:1; regdn = sext(tmp); } +@ifdef COLDFIRE +:halt is d16=0x4ac8 unimpl +@endif + :illegal is d16=0x4afc unimpl # jump addresses derived from effective address calculation