-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path4055-Add-MC6800-processor-specs.patch
More file actions
5003 lines (4995 loc) · 126 KB
/
Copy path4055-Add-MC6800-processor-specs.patch
File metadata and controls
5003 lines (4995 loc) · 126 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sigurdur Asgeirsson <siggi@undo.com>
Date: Sat, 5 Mar 2022 16:31:33 -0500
Subject: [PATCH] 4055: Add MC6800 processor specs.
Fix JSR/JMP to use EA rather than the dereferenced address.
Fix arithmetic shift right to keep MSB.
Rename OP2EA->EA2.
Revert "Fix arithmetic shift right to keep MSB.", the original implementation is just fine.
Fix spec ID.
Change to https://github.com/sigurasg/GhidraMC6800
---
.../Processors/MC6800/certification.manifest | 30 +
.../MC6800/data/languages/hd6301.sinc | 86 ++
.../MC6800/data/languages/hd6301.slaspec | 20 +
.../MC6800/data/languages/mc6800.cspec | 46 +
.../MC6800/data/languages/mc6800.ldefs | 69 ++
.../MC6800/data/languages/mc6800.pspec | 26 +
.../MC6800/data/languages/mc6800.sinc | 960 ++++++++++++++++++
.../MC6800/data/languages/mc6800.slaspec | 17 +
.../MC6800/data/languages/mc6801.pspec | 54 +
.../MC6800/data/languages/mc6801.sinc | 83 ++
.../MC6800/data/languages/mc6801.slaspec | 19 +
.../MC6800/data/languages/mc68hc11.sinc | 486 +++++++++
.../MC6800/data/languages/mc68hc11.slaspec | 21 +
.../Processors/MC6800/data/manuals/README.txt | 4 +
.../Processors/MC6800/data/manuals/mc6800.idx | 73 ++
.../Processors/MC6800/data/manuals/mc6801.idx | 88 ++
.../is/sort/mc6800/MC6800JSRAnalyzer.java | 98 ++
.../is/sort/mc6800/AbstractEmulatorTest.java | 194 ++++
.../sort/mc6800/AbstractIntegrationTest.java | 77 ++
.../src/test/java/is/sort/mc6800/CC.java | 24 +
.../is/sort/mc6800/DisassemblyCommonTest.java | 681 +++++++++++++
.../is/sort/mc6800/DisassemblyHD6301Test.java | 73 ++
.../is/sort/mc6800/DisassemblyMC6800Test.java | 49 +
.../mc6800/DisassemblyMC6801CommonTest.java | 94 ++
.../is/sort/mc6800/DisassemblyMC6801Test.java | 41 +
.../sort/mc6800/DisassemblyMC68HC11Test.java | 414 ++++++++
.../is/sort/mc6800/EmulatorHD6301Test.java | 79 ++
.../is/sort/mc6800/EmulatorMC6800Test.java | 153 +++
.../is/sort/mc6800/EmulatorMC6801Test.java | 61 ++
.../is/sort/mc6800/EmulatorMC68HC11Test.java | 565 +++++++++++
.../is/sort/mc6800/MC6800JSRAnalyzerTest.java | 44 +
31 files changed, 4729 insertions(+)
create mode 100644 Ghidra/Processors/MC6800/data/languages/hd6301.sinc
create mode 100644 Ghidra/Processors/MC6800/data/languages/hd6301.slaspec
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6800.cspec
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6800.ldefs
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6800.pspec
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6800.sinc
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6800.slaspec
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6801.pspec
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6801.sinc
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc6801.slaspec
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc68hc11.sinc
create mode 100644 Ghidra/Processors/MC6800/data/languages/mc68hc11.slaspec
create mode 100644 Ghidra/Processors/MC6800/data/manuals/README.txt
create mode 100644 Ghidra/Processors/MC6800/data/manuals/mc6800.idx
create mode 100644 Ghidra/Processors/MC6800/data/manuals/mc6801.idx
create mode 100644 Ghidra/Processors/MC6800/src/main/java/is/sort/mc6800/MC6800JSRAnalyzer.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/AbstractEmulatorTest.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/AbstractIntegrationTest.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/CC.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/DisassemblyCommonTest.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/DisassemblyHD6301Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/DisassemblyMC6800Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/DisassemblyMC6801CommonTest.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/DisassemblyMC6801Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/DisassemblyMC68HC11Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/EmulatorHD6301Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/EmulatorMC6800Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/EmulatorMC6801Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/EmulatorMC68HC11Test.java
create mode 100644 Ghidra/Processors/MC6800/src/test/java/is/sort/mc6800/MC6800JSRAnalyzerTest.java
diff --git a/Ghidra/Processors/MC6800/certification.manifest b/Ghidra/Processors/MC6800/certification.manifest
index f2d77d9f3d..3329d5c47d 100644
--- a/Ghidra/Processors/MC6800/certification.manifest
+++ b/Ghidra/Processors/MC6800/certification.manifest
@@ -21,4 +21,34 @@ data/languages/6x09_push.sinc||GHIDRA||||END|
data/languages/H6309.slaspec||GHIDRA||||END|
data/languages/mc146805e2.pspec||GHIDRA||||END|
data/languages/mc146805e2.slaspec||GHIDRA||||END|
+data/languages/hd6301.sinc||Apache_License_2.0||||END|
+data/languages/hd6301.slaspec||Apache_License_2.0||||END|
+data/languages/mc6800.cspec||Apache_License_2.0||||END|
+data/languages/mc6800.ldefs||Apache_License_2.0||||END|
+data/languages/mc6800.pspec||Apache_License_2.0||||END|
+data/languages/mc6800.sinc||Apache_License_2.0||||END|
+data/languages/mc6800.slaspec||Apache_License_2.0||||END|
+data/languages/mc6801.pspec||Apache_License_2.0||||END|
+data/languages/mc6801.sinc||Apache_License_2.0||||END|
+data/languages/mc6801.slaspec||Apache_License_2.0||||END|
+data/languages/mc68hc11.sinc||Apache_License_2.0||||END|
+data/languages/mc68hc11.slaspec||Apache_License_2.0||||END|
data/manuals/6809.idx||GHIDRA||||END|
+data/manuals/mc6800.idx||Apache_License_2.0||||END|
+data/manuals/mc6801.idx||Apache_License_2.0||||END|
+data/manuals/README.txt||Apache_License_2.0||||END|
+src/main/java/is/sort/mc6800/MC6800JSRAnalyzer.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/AbstractEmulatorTest.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/AbstractIntegrationTest.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/CC.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/DisassemblyCommonTest.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/DisassemblyHD6301Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/DisassemblyMC6800Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/DisassemblyMC6801CommonTest.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/DisassemblyMC6801Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/DisassemblyMC68HC11Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/EmulatorHD6301Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/EmulatorMC6800Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/EmulatorMC6801Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/EmulatorMC68HC11Test.java||Apache_License_2.0||||END|
+src/test/java/is/sort/mc6800/MC6800JSRAnalyzerTest.java||Apache_License_2.0||||END|
diff --git a/Ghidra/Processors/MC6800/data/languages/hd6301.sinc b/Ghidra/Processors/MC6800/data/languages/hd6301.sinc
new file mode 100644
index 0000000000..95e7deb507
--- /dev/null
+++ b/Ghidra/Processors/MC6800/data/languages/hd6301.sinc
@@ -0,0 +1,86 @@
+# Copyright 2024 Sigurdur Asgeirsson <siggi@sort.is>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# 1-byte immediate operand.
+IMM1: "#"imm8 is imm8
+{
+ export &:1 imm8;
+}
+
+# 1-byte displacement operand.
+DISP1: imm8,X is X; imm8
+{
+ local tmp:2 = imm8 + X;
+ export *:1 tmp;
+}
+# 1-byte memory operand.
+M1: imm8 is imm8
+{
+ export *:1 imm8;
+}
+
+:AIM IMM1, M1 is op=0x71; IMM1; M1
+{
+ logicalAnd(M1, IMM1);
+}
+
+:AIM IMM1, DISP1 is op=0x61; IMM1; DISP1
+{
+ logicalAnd(DISP1, IMM1);
+}
+
+:OIM IMM1, M1 is op=0x72; IMM1; M1
+{
+ logicalOr(M1, IMM1);
+}
+
+:OIM IMM1, DISP1 is op=0x62; IMM1; DISP1
+{
+ logicalOr(DISP1, IMM1);
+}
+
+:EIM IMM1, M1 is op=0x75; IMM1; M1
+{
+ logicalExclusiveOr(M1, IMM1);
+}
+
+:EIM IMM1, DISP1 is op=0x65; IMM1; DISP1
+{
+ logicalExclusiveOr(DISP1, IMM1);
+}
+
+:TIM IMM1, M1 is op=0x7B; IMM1; M1
+{
+ bitTest(M1, IMM1);
+}
+
+:TIM IMM1, DISP1 is op=0x6B; IMM1; DISP1
+{
+ bitTest(DISP1, IMM1);
+}
+
+:XGDX is op=0x18
+ {
+ local tmp:2=X;
+ X=D;
+ D=tmp;
+ }
+
+:SLP is op=0x1A
+{
+ # Sleeps the MPU, but for the purposes of analysis,
+ # execution continues after an interrupt, so this looks
+ # like a noop.
+ goto inst_next;
+}
diff --git a/Ghidra/Processors/MC6800/data/languages/hd6301.slaspec b/Ghidra/Processors/MC6800/data/languages/hd6301.slaspec
new file mode 100644
index 0000000000..7c8d501359
--- /dev/null
+++ b/Ghidra/Processors/MC6800/data/languages/hd6301.slaspec
@@ -0,0 +1,20 @@
+# Copyright 2024 Sigurdur Asgeirsson <siggi@sort.is>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+@define HAS_D_REGISTER "1"
+@define HAS_2_BYTE_JSR_JMP "1"
+
+@include "mc6800.sinc"
+@include "mc6801.sinc"
+@include "hd6301.sinc"
diff --git a/Ghidra/Processors/MC6800/data/languages/mc6800.cspec b/Ghidra/Processors/MC6800/data/languages/mc6800.cspec
new file mode 100644
index 0000000000..0b48b14013
--- /dev/null
+++ b/Ghidra/Processors/MC6800/data/languages/mc6800.cspec
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2022-2024 Sigurdur Asgeirsson <siggi@sort.is>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<compiler_spec>
+ <global>
+ <range space="RAM"/>
+ </global>
+ <stackpointer register="S" 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>
+ <pentry minsize="1" maxsize="2">
+ <register name="X"/>
+ </pentry>
+ </input>
+ <output>
+ <pentry minsize="1" maxsize="1">
+ <register name="A"/>
+ </pentry>
+ </output>
+ <unaffected>
+ <register name="S"/>
+ </unaffected>
+ </prototype>
+ </default_proto>
+</compiler_spec>
diff --git a/Ghidra/Processors/MC6800/data/languages/mc6800.ldefs b/Ghidra/Processors/MC6800/data/languages/mc6800.ldefs
new file mode 100644
index 0000000000..8d9e4d272e
--- /dev/null
+++ b/Ghidra/Processors/MC6800/data/languages/mc6800.ldefs
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2022-2024 Sigurdur Asgeirsson <siggi@sort.is>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<language_definitions>
+ <language processor="MC6800"
+ endian="big"
+ size="16"
+ variant="default"
+ version="1.0"
+ slafile="mc6800.sla"
+ manualindexfile="../manuals/mc6800.idx"
+ processorspec="mc6800.pspec"
+ id="MC6800:BE:16:default">
+ <description>MC6800 Microprocessor</description>
+ <compiler name="default" spec="mc6800.cspec" id="default"/>
+ <external_name tool="IDA-PRO" name="MC6800"/>
+ <external_name tool="IDA-PRO" name="MC6802"/>
+ <external_name tool="IDA-PRO" name="MC6808"/>
+ </language>
+ <language processor="MC6801"
+ endian="big"
+ size="16"
+ variant="default"
+ version="1.0"
+ slafile="mc6801.sla"
+ manualindexfile="../manuals/mc6801.idx"
+ processorspec="mc6801.pspec"
+ id="MC6801:BE:16:default">
+ <description>MC6801 Microprocessor</description>
+ <compiler name="default" spec="mc6800.cspec" id="default"/>
+ <external_name tool="IDA-PRO" name="MC6801"/>
+ </language>
+ <language processor="HD6301"
+ endian="big"
+ size="16"
+ variant="default"
+ version="1.0"
+ slafile="hd6301.sla"
+ processorspec="mc6801.pspec"
+ id="HD6301:BE:16:default">
+ <description>HD6301 Microprocessor</description>
+ <compiler name="default" spec="mc6800.cspec" id="default"/>
+ </language>
+ <language processor="MC68HC11"
+ endian="big"
+ size="16"
+ variant="default"
+ version="1.0"
+ slafile="mc68hc11.sla"
+ processorspec="mc6801.pspec"
+ id="MC68HC11:BE:16:default">
+ <description>MC68HC11 Microprocessor</description>
+ <compiler name="default" spec="mc6800.cspec" id="default"/>
+ </language>
+</language_definitions>
diff --git a/Ghidra/Processors/MC6800/data/languages/mc6800.pspec b/Ghidra/Processors/MC6800/data/languages/mc6800.pspec
new file mode 100644
index 0000000000..1d2a22fdf7
--- /dev/null
+++ b/Ghidra/Processors/MC6800/data/languages/mc6800.pspec
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2022-2024 Sigurdur Asgeirsson <siggi@sort.is>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<processor_spec>
+ <programcounter register="PC"/>
+ <default_symbols>
+ <symbol name="IRQ_VECTOR" address="0xFFF8" entry="true" type="code_ptr"/>
+ <symbol name="SWI_VECTOR" address="0xFFFA" entry="true" type="code_ptr"/>
+ <symbol name="NMI_VECTOR" address="0xFFFC" entry="true" type="code_ptr"/>
+ <symbol name="RST_VECTOR" address="0xFFFE" entry="true" type="code_ptr"/>
+ </default_symbols>
+</processor_spec>
diff --git a/Ghidra/Processors/MC6800/data/languages/mc6800.sinc b/Ghidra/Processors/MC6800/data/languages/mc6800.sinc
new file mode 100644
index 0000000000..784a2db9bd
--- /dev/null
+++ b/Ghidra/Processors/MC6800/data/languages/mc6800.sinc
@@ -0,0 +1,960 @@
+# Copyright 2022-2024 Sigurdur Asgeirsson <siggi@sort.is>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+define endian=big;
+define alignment=1;
+
+@define SWI_VECTOR "0xFFFA"
+
+define space RAM type=ram_space size=2 default;
+define space register type=register_space size=1;
+
+# 8-bit registers A, B, CC
+define register offset=0x00 size=1 [ A B CC ];
+
+@ifdef HAS_D_REGISTER
+define register offset=0x00 size=2 [ D ];
+@endif
+
+# 16-bit registers:
+ # PC: Program counter
+ # S: Stack pointer
+ # X: IX index register
+# Y: IY index register (MC68HC11)
+@ifdef HAS_Y_REGISTER
+define register offset=0x10 size=2 [ PC S X Y ];
+@else
+define register offset=0x10 size=2 [ PC S X ];
+@endif
+
+# Status bits in CC.
+define bitrange
+ C=CC[0,1] # C: Carry (or borrow) flag
+ V=CC[1,1] # V: Overflow flag
+ Z=CC[2,1] # Z: Zero result
+ N=CC[3,1] # N: Negative result (twos complement)
+ I=CC[4,1] # I: IRQ interrupt masked
+ H=CC[5,1] # H: Half carry flag
+;
+
+define token opbyte (8)
+ op = (0,7)
+ addrMode = (4,5)
+ acc_4 = (4,4)
+;
+
+define token data8 (8)
+ imm8 = (0,7)
+ simm8 = (0,7) signed
+;
+
+define token data (16)
+ imm16 = (0,15)
+;
+
+attach variables acc_4 [ A B ];
+
+################################################################
+# Constructors
+################################################################
+
+REL: addr is simm8 [ addr = inst_next + simm8; ] { export *:2 addr; }
+
+# 1-byte operand, immediate/direct/indexed/extended addressing mode
+OP1: "#"imm8 is addrMode=0; imm8
+{
+ # For some reason this needs explicit sizing, or the p-code
+ # ends up picking up a zero value for all #imm8 operands.
+ export &:1 imm8;
+}
+OP1: imm8 is addrMode=1; imm8
+{
+ export *:1 imm8;
+}
+OP1: imm8,X is addrMode=2 & X; imm8
+{
+ local tmp:2 = imm8 + X;
+ export *:1 tmp;
+}
+OP1: imm16 is addrMode=3; imm16
+{
+ export *:1 imm16;
+}
+
+# 2-byte operand, direct/indexed/extended addressing mode
+OP2: "#"imm16 is addrMode=0; imm16
+{
+ export &:2 imm16;
+}
+OP2: imm8 is addrMode=1; imm8
+{
+ export *:2 imm8;
+}
+OP2: imm8,X is addrMode=2 & X; imm8
+{
+ local tmp:2 = X + imm8;
+ export *:2 tmp;
+}
+OP2: imm16 is addrMode=3; imm16
+{
+ export *:2 imm16;
+}
+
+@ifdef HAS_2_BYTE_JSR_JMP
+# This looks weird, but it is the only way I found to force the
+# disassembly to emit a single byte hex code.
+EA8: addr is imm8 [ addr = imm8 & 0xFF; ]
+{
+ export *:1 imm8;
+}
+@endif
+
+EA16: imm16 is imm16
+{
+ export *:1 imm16;
+}
+
+EAX: imm8,X is imm8 & X
+{
+ local tmp:2 = X + imm8;
+ export tmp;
+}
+
+
+################################################################
+# Macros
+################################################################
+
+macro setNZFlags(result)
+{
+ Z = (result == 0);
+ N = (result s< 0);
+}
+
+macro setHFlag(reg, op)
+{
+ local mask = 0x0F; # Low nibble mask
+
+ H = (((reg & mask) + (op & mask)) >> 4) & 1;
+}
+
+# Negate twos complement value in op.
+# P-code INT_2COMP.
+macro negate(op)
+{
+ op = -op;
+ V = (op == 0x80);
+ C = (op != 0);
+ setNZFlags(op);
+}
+
+# Logical complement of op. (0 => 1; 1 => 0)
+# P-code INT_NEGATE.
+macro complement(op)
+{
+ V = 0;
+ C = 1;
+ op = ~op;
+ setNZFlags(op);
+}
+
+macro logicalShiftRight(op)
+{
+ C = op & 1;
+ op = op >> 1;
+ Z = (op == 0);
+ N = 0;
+}
+
+macro rotateRightWithCarry(op)
+{
+ local carryOut = C << 7;
+ C = op & 1;
+ op = (op s>> 1) | carryOut;
+ setNZFlags(op);
+}
+
+macro rotateLeftWithCarry(op)
+{
+ local carryIn = C;
+ C = op >> 7;
+ op = (op << 1) | carryIn;
+ setNZFlags(op);
+}
+
+# Signed shift right.
+# P-code INT_SRIGHT.
+macro arithmeticShiftRight(op)
+{
+ C = op & 1;
+ op = (op s>> 1);
+ setNZFlags(op);
+}
+
+macro logicalShiftLeft(op)
+{
+ C = (op >> 7);
+ op = op << 1;
+ Z = (op == 0);
+ N = (op >> 7);
+}
+
+macro increment(op)
+{
+ V = (op == 0x7F);
+ op = op + 1;
+ setNZFlags(op);
+}
+
+macro decrement(op)
+{
+ V = (op == 0x80);
+ op = op - 1;
+ setNZFlags(op);
+}
+
+macro test(op)
+{
+ V = 0;
+ setNZFlags(op);
+}
+
+macro clear(op)
+{
+ op = 0;
+ N = 0;
+ Z = 1;
+ V = 0;
+ C = 0;
+}
+
+macro addition(reg, op)
+{
+ C = carry(reg, op);
+ V = scarry(reg, op);
+
+ reg = reg + op;
+
+ setNZFlags(reg);
+}
+
+macro additionWithCarry(reg, op)
+{
+ local carryIn = C;
+ local mask = 0x0F; # Low nibble mask
+ local tmpResult = reg + op;
+
+ H = (((reg & mask) + (op & mask) + carryIn) >> 4) & 1;
+ C = carry(reg, op) || carry(tmpResult, carryIn);
+ V = scarry(reg, op) ^^ scarry(tmpResult, carryIn);
+
+ reg = tmpResult + carryIn;
+
+ setNZFlags(reg);
+}
+
+macro subtraction(reg, op)
+{
+ V = sborrow(reg, op);
+ C = (reg < op);
+ reg = reg - op;
+ setNZFlags(reg);
+}
+
+macro subtractionWithCarry(reg, op)
+{
+ local carryIn = C;
+ local tmpResult = reg - op;
+
+ C = (reg < op) || (tmpResult < carryIn);
+ V = sborrow(reg, op) ^^ sborrow(tmpResult, carryIn);
+
+ reg = tmpResult - carryIn;
+
+ setNZFlags(reg);
+}
+
+macro compare(reg, op)
+{
+ V = sborrow(reg, op);
+ C = (reg < op);
+ local tmp = reg - op;
+ setNZFlags(tmp);
+}
+
+macro logicalAnd(reg, op)
+{
+ reg = reg & op;
+ setNZFlags(reg);
+ V = 0;
+}
+
+macro logicalOr(reg, op)
+{
+ reg = reg | op;
+ setNZFlags(reg);
+ V = 0;
+}
+
+macro logicalExclusiveOr(reg, op)
+{
+ reg = reg ^ op;
+ setNZFlags(reg);
+ V = 0;
+}
+
+macro bitTest(reg, op)
+{
+ local tmp = reg & op;
+ setNZFlags(tmp);
+ V = 0;
+}
+
+macro loadRegister(reg, op)
+{
+ reg = op;
+ setNZFlags(reg);
+ V = 0;
+}
+
+macro storeRegister(reg, op)
+{
+ op = reg;
+ setNZFlags(reg);
+ V = 0;
+}
+
+# Push 1 byte operand op
+macro Push1(reg, op)
+{
+ *:1 reg = op;
+ reg = reg - 1;
+}
+
+# Push 2 byte operand op
+macro Push2(reg, op)
+{
+ *:2 (reg - 1) = op;
+ reg = reg - 2;
+}
+
+# Pull 1 byte operand op
+macro Pull1(reg, op)
+{
+ reg = reg + 1;
+ op = *:1 reg;
+}
+
+# Pull 2 byte operand op
+macro Pull2(reg, op)
+{
+ reg = reg + 1;
+ op = *:2 reg;
+ reg = reg + 1;
+}
+
+macro PushEntireState()
+{
+ Push2(S, &:2 inst_next); # return PC address
+ Push2(S, X);
+ Push1(S, A);
+ Push1(S, B);
+ Push1(S, CC);
+}
+
+################################################################
+# Instructions
+################################################################
+
+################################################################
+# Opcode 0x00 - 0x0F, misc operations
+################################################################
+
+:NOP is op=0x01
+{
+ # Intentional NOP.
+ goto inst_next;
+}
+
+:TAP is op=0x06
+{
+ CC = A & 0x1F;
+}
+
+:TPA is op=0x07
+{
+ A = CC;
+}
+
+:INX is op=0x08
+{
+ X = X + 1;
+ Z = (X == 0);
+}
+
+:DEX is op=0x09
+{
+ X = X - 1;
+ Z = (X == 0);
+}
+
+:CLV is op=0x0A
+{
+ V = 0;
+}
+
+:SEV is op=0x0B
+{
+ V = 1;
+}
+
+:CLC is op=0x0C
+{
+ C = 0;
+}
+
+:SEC is op=0x0D
+{
+ C = 1;
+}
+
+:CLI is op=0x0E
+{
+ I = 0;
+}
+
+:SEI is op=0x0F
+{
+ I = 1;
+}
+
+################################################################
+# Opcode 0x40 - 0x4F, register A addressing
+# Opcode 0x50 - 0x5F, register B addressing
+# Opcode 0x60 - 0x6F, indexed addressing
+# Opcode 0x70 - 0x7F, extended addressing
+################################################################
+
+:NEG^acc_4 is (op=0x40 | op=0x50) & acc_4
+{
+ negate(acc_4);
+}
+
+:NEG OP1 is (op=0x60 | op=0x70) ... & OP1
+{
+ negate(OP1);
+}
+
+:COM^acc_4 is (op=0x43 | op=0x53) & acc_4
+{
+ complement(acc_4);
+}
+
+:COM OP1 is (op=0x63 | op=0x73) ... & OP1
+{
+ complement(OP1);
+}
+
+:LSR^acc_4 is (op=0x44 | op=0x54) & acc_4
+{
+ logicalShiftRight(acc_4);
+}
+
+:LSR OP1 is (op=0x64 | op=0x74) ... & OP1
+{
+ logicalShiftRight(OP1);
+}
+
+:ROR^acc_4 is (op=0x46 | op=0x56) & acc_4
+{
+ rotateRightWithCarry(acc_4);
+}
+
+:ROR OP1 is (op=0x66 | op=0x76) ... & OP1
+{
+ rotateRightWithCarry(OP1);
+}
+
+:ASR^acc_4 is (op=0x47 | op=0x57) & acc_4
+{
+ arithmeticShiftRight(acc_4);
+}
+
+:ASR OP1 is (op=0x67 | op=0x77) ... & OP1
+{
+ arithmeticShiftRight(OP1);
+}
+
+:ASL^acc_4 is (op=0x48 | op=0x58) & acc_4
+{
+ logicalShiftLeft(acc_4);
+}
+
+:ASL OP1 is (op=0x68 | op=0x78) ... & OP1
+{
+ logicalShiftLeft(OP1);
+}
+
+:ROL^acc_4 is (op=0x49 | op=0x59) & acc_4
+{
+ rotateLeftWithCarry(acc_4);
+}
+
+:ROL OP1 is (op=0x69 | op=0x79) ... & OP1
+{
+ rotateLeftWithCarry(OP1);
+}
+
+:DEC^acc_4 is (op=0x4A | op=0x5A) & acc_4
+{
+ decrement(acc_4);
+}
+
+:DEC OP1 is (op=0x6A | op=0x7A) ... & OP1
+{
+ decrement(OP1);
+}
+
+:INC^acc_4 is (op=0x4C | op=0x5C) & acc_4
+{
+ increment(acc_4);
+}
+
+:INC OP1 is (op=0x6C | op=0x7C) ... & OP1
+{
+ increment(OP1);
+}
+
+:TST^acc_4 is (op=0x4D | op=0x5D) & acc_4
+{
+ test(acc_4);
+}
+
+:TST OP1 is (op=0x6D | op=0x7D) ... & OP1
+{
+ test(OP1);
+}
+
+:JMP EAX is op=0x6E; EAX
+{
+ goto [EAX];
+}
+
+:JMP EA16 is op=0x7E; EA16
+{
+ goto EA16;
+}
+
+:CLR^acc_4 is (op=0x4F | op=0x5F) & acc_4
+{
+ clear(acc_4);
+}
+
+:CLR OP1 is (op=0x6F | op=0x7F) ... & OP1
+{
+ clear(OP1);
+}
+
+################################################################
+# Opcode 0x10 - 0x1F, misc. addressing
+################################################################
+
+:SBA is op=0x10
+{
+ subtraction(A, B);
+}
+
+:CBA is op=0x11
+{
+ compare(A, B);
+}
+
+:TAB is op=0x16
+{
+ loadRegister(B, A);
+}
+
+:TBA is op=0x17
+{
+ loadRegister(A, B);
+}
+
+:DAA is op=0x19
+{
+ local highA:1 = A >> 4;
+ local lowA:1 = A & 0x0F;
+ local cc1 = (C == 1 | highA > 9 | (highA > 8) & (lowA > 9));
+ local cc2 = (H == 1 | lowA > 9);