Skip to content

Commit

Permalink
[MC6809] Fix DIVD/DIVQ/MULD bus cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
tgtakaoka committed May 2, 2024
1 parent aa3dbdf commit be2699d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
18 changes: 9 additions & 9 deletions debugger/mc6809/hd6309-P11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ op nemo oper ~ # sequence
8A - - - - -
8B ADDE #n8 2 2 1:2:N
8C CMPS #n16 4/3 3 1:2:3:x:N/1:2:3:N
8D DIVD #n8 24 2 1:2:N:Z:N
8E DIVQ #n16 33 3 1:2:3:N:Z:N
8F MULD #n18 27 2 1:2:3:N:Z:N
8D DIVD #n8 24 2 1:2:Z:N
8E DIVQ #n16 33 3 1:2:3:Z:N
8F MULD #n18 27 2 1:2:3:Z:N
90 SUBE d8 4/3 2 1:2:x:R:N/1:2:R:N
91 CMPE d8 4/3 2 1:2:x:R:N/1:2:R:N
92 - - - - -
Expand All @@ -157,9 +157,9 @@ op nemo oper ~ # sequence
9A - - - - -
9B ADDE d8 4/3 2 1:2:x:R:N/1:2:R:N
9C CMPS d8 6/4 2 1:2:x:R:r:x:N/1:2:R:r:N
9D DIVD d8 26/25 2 1:2:x:R:Z:N
9E DIVQ d8 35/34 2 1:2:x:R:r:Z:N
9F MULD d8 29/28 2 1:2:x:R:r:Z:N
9D DIVD d8 26/25 2 1:2:x:R:Z:N/1:2:R:Z:N
9E DIVQ d8 35/34 2 1:2:x:R:r:Z:N/1:2:R:r:Z:N
9F MULD d8 29/28 2 1:2:x:R:r:Z:N/1:2:R:r:Z:N
A0 SUBE ix 4+ 2+ 1:2:Y:R:N
A1 CMPE ix 4+ 2+ 1:2:Y:R:N
A2 - - - - -
Expand Down Expand Up @@ -189,9 +189,9 @@ B9 - - - - -
BA - - - - -
BB ADDE a16 5/4 3 1:2:3:x:A:N/1:2:3:A:N
BC CMPS a16 7/5 3 1:2:3:x:A:a:x:N/1:2:3:A:a:N
BD DIVD a16 27/26 3 1:2:3:x:R:Z:N
BE DIVQ a16 36/35 3 1:2:3:x:R:r:Z:N
BF MULD a16 30/29 3 1:2:3:x:R:r:Z:N
BD DIVD a16 27/26 3 1:2:3:x:R:Z:N/1:2:3:R:Z:N
BE DIVQ a16 36/35 3 1:2:3:x:R:r:Z:N/1:2:3:R:r:Z:N
BF MULD a16 30/29 3 1:2:3:x:R:r:Z:N/1:2:3:R:r:Z:N
C0 SUBF #n8 2 2 1:2:N
C1 CMPF #n8 2 2 1:2:N
C2 - - - - -
Expand Down
12 changes: 6 additions & 6 deletions debugger/mc6809/inst_hd6309.awk
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ BEGIN {
CYCLES[90]="123xRxWN/123RxWN";
CYCLES[91]="12xxxTN";
CYCLES[92]="12XxN";
CYCLES[93]="12NZN";
CYCLES[94]="123NZN";
CYCLES[95]="12xRZN";
CYCLES[96]="12xRrZN";
CYCLES[93]="12ZN";
CYCLES[94]="123ZN";
CYCLES[95]="12xRZN/12RZN";
CYCLES[96]="12xRrZN/12RrZN";
CYCLES[97]="12YRZN";
CYCLES[98]="12YRrZN";
CYCLES[99]="123xRZN";
CYCLES[100]="123xRrZN";
CYCLES[99]="123xRZN/123RZN";
CYCLES[100]="123xRrZN/123RrZN";

if (GENERATE_CYCLES == 1)
delete CYCLES;
Expand Down
30 changes: 15 additions & 15 deletions debugger/mc6809/inst_hd6309.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ constexpr const char *const SEQUENCES[/*seq*/] = {
"123xRxWN/123RxWN", // 90
"12xxxTN", // 91
"12XxN", // 92
"12NZN", // 93
"123NZN", // 94
"12xRZN", // 95
"12xRrZN", // 96
"12ZN", // 93
"123ZN", // 94
"12xRZN/12RZN", // 95
"12xRrZN/12RrZN", // 96
"12YRZN", // 97
"12YRrZN", // 98
"123xRZN", // 99
"123xRrZN", // 100
"123xRZN/123RZN", // 99
"123xRrZN/123RrZN", // 100
};

constexpr uint8_t IX_TABLE[] = {
Expand Down Expand Up @@ -1038,9 +1038,9 @@ constexpr uint8_t P11_TABLE[] = {
0, // 8A: - - - - -
54, // 8B: ADDE #n8 2 2 1:2:N
55, // 8C: CMPS #n16 4/3 3 1:2:3:x:N/1:2:3:N
93, // 8D: DIVD #n8 24 2 1:2:N:Z:N
94, // 8E: DIVQ #n16 33 3 1:2:3:N:Z:N
94, // 8F: MULD #n18 27 2 1:2:3:N:Z:N
93, // 8D: DIVD #n8 24 2 1:2:Z:N
94, // 8E: DIVQ #n16 33 3 1:2:3:Z:N
94, // 8F: MULD #n18 27 2 1:2:3:Z:N
58, // 90: SUBE d8 4/3 2 1:2:x:R:N/1:2:R:N
58, // 91: CMPE d8 4/3 2 1:2:x:R:N/1:2:R:N
0, // 92: - - - - -
Expand All @@ -1054,9 +1054,9 @@ constexpr uint8_t P11_TABLE[] = {
0, // 9A: - - - - -
58, // 9B: ADDE d8 4/3 2 1:2:x:R:N/1:2:R:N
59, // 9C: CMPS d8 6/4 2 1:2:x:R:r:x:N/1:2:R:r:N
95, // 9D: DIVD d8 26/25 2 1:2:x:R:Z:N
96, // 9E: DIVQ d8 35/34 2 1:2:x:R:r:Z:N
96, // 9F: MULD d8 29/28 2 1:2:x:R:r:Z:N
95, // 9D: DIVD d8 26/25 2 1:2:x:R:Z:N/1:2:R:Z:N
96, // 9E: DIVQ d8 35/34 2 1:2:x:R:r:Z:N/1:2:R:r:Z:N
96, // 9F: MULD d8 29/28 2 1:2:x:R:r:Z:N/1:2:R:r:Z:N
64, // A0: SUBE ix 4+ 2+ 1:2:Y:R:N
64, // A1: CMPE ix 4+ 2+ 1:2:Y:R:N
0, // A2: - - - - -
Expand Down Expand Up @@ -1086,9 +1086,9 @@ constexpr uint8_t P11_TABLE[] = {
0, // BA: - - - - -
70, // BB: ADDE a16 5/4 3 1:2:3:x:A:N/1:2:3:A:N
71, // BC: CMPS a16 7/5 3 1:2:3:x:A:a:x:N/1:2:3:A:a:N
99, // BD: DIVD a16 27/26 3 1:2:3:x:R:Z:N
100, // BE: DIVQ a16 36/35 3 1:2:3:x:R:r:Z:N
100, // BF: MULD a16 30/29 3 1:2:3:x:R:r:Z:N
99, // BD: DIVD a16 27/26 3 1:2:3:x:R:Z:N/1:2:3:R:Z:N
100, // BE: DIVQ a16 36/35 3 1:2:3:x:R:r:Z:N/1:2:3:R:r:Z:N
100, // BF: MULD a16 30/29 3 1:2:3:x:R:r:Z:N/1:2:3:R:r:Z:N
54, // C0: SUBF #n8 2 2 1:2:N
54, // C1: CMPF #n8 2 2 1:2:N
0, // C2: - - - - -
Expand Down
2 changes: 1 addition & 1 deletion debugger/mc6809/pins_mc6809.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ bool PinsMc6809::matchAll(Signals *begin, const Signals *end) {

const Signals *PinsMc6809::findFetch(Signals *begin, const Signals *end) {
const auto cycles = begin->diff(end);
const auto limit = cycles < 30 ? cycles : 30;
const auto limit = cycles < 40 ? cycles : 40;
LOG_MATCH(cli.print("@@ findFetch: begin="));
LOG_MATCH(begin->print());
LOG_MATCH(cli.print("@@ end="));
Expand Down

0 comments on commit be2699d

Please sign in to comment.