Skip to content

Commit ddc361c

Browse files
librz/arch: fix 6808 naming and add CPU aliases for 6802, 6803, 6808 (#5939)
1 parent 6a9eef6 commit ddc361c

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

librz/arch/p/analysis/analysis_m680x_cs.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ static int m680xmode(const char *str) {
1212
return CS_MODE_M680X_6800;
1313
}
1414
// replace this with the asm.features?
15-
if (str && strstr(str, "6800")) {
15+
if (str && (strstr(str, "6800") || strstr(str, "6802") || strstr(str, "6808"))) {
1616
return CS_MODE_M680X_6800;
1717
}
18-
if (str && strstr(str, "6801")) {
18+
if (str && (strstr(str, "6801") || strstr(str, "6803"))) {
1919
return CS_MODE_M680X_6801;
2020
} else if (str && strstr(str, "6805")) {
2121
return CS_MODE_M680X_6805;
22-
} else if (str && strstr(str, "6808")) {
22+
} else if (str && strstr(str, "68HC08")) {
2323
return CS_MODE_M680X_6808;
24+
} else if (strstr(str, "6808")) {
25+
return CS_MODE_M680X_6800;
2426
} else if (str && strstr(str, "6809")) {
2527
return CS_MODE_M680X_6809;
2628
} else if (str && strstr(str, "6811")) {

librz/arch/p/asm/asm_m680x_cs.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ static cs_mode m680x_mode(const char *str) {
1212
return CS_MODE_M680X_6800;
1313
}
1414
// replace this with the asm.features?
15-
if (strstr(str, "6800")) {
15+
if (strstr(str, "6800") || strstr(str, "6802") || strstr(str, "6808")) {
1616
return CS_MODE_M680X_6800;
1717
}
18-
if (strstr(str, "6801")) {
18+
if (strstr(str, "6801") || strstr(str, "6803")) {
1919
return CS_MODE_M680X_6801;
2020
} else if (strstr(str, "6805")) {
2121
return CS_MODE_M680X_6805;
22-
} else if (strstr(str, "6808")) {
22+
} else if (strstr(str, "68HC08")) {
2323
return CS_MODE_M680X_6808;
24+
} else if (strstr(str, "6808")) {
25+
return CS_MODE_M680X_6800;
2426
} else if (strstr(str, "6809")) {
2527
return CS_MODE_M680X_6809;
2628
} else if (strstr(str, "6811")) {
@@ -83,8 +85,11 @@ static char **m680x_cpu_descriptions() {
8385
static char *cpu_desc[] = {
8486
"6800", "Motorola 6800: 8-bit microprocessor launched in 1974",
8587
"6801", "Motorola 6801: Enhanced version of the 6800 with additional features like on-chip RAM and timers.",
88+
"6802", "Motorola 6802: Enhanced version of the 6800 with 128 bytes of on-chip RAM and internal clock",
89+
"6803", "Motorola 6803: Version of 6801 without internal ROM",
8690
"6805", "Motorola 68HC05: 8-bit microcontroller",
8791
"6808", "Motorola 6808: Variant of the 6800 microprocessor",
92+
"68HC08", "Motorola 68HC08: 8-bit microcontroller (abbreviated as HC08)",
8893
"6809", "Motorola 6809: Advanced 8-bit microprocessor",
8994
"6811", "Motorola 68HC11: 8-bit microcontroller (also abbreviated as 6811 or HC11)",
9095
"cpu12", "Motorola 68HC12: 16-bit microcontroller (also abbreviated as 6812 or HC12)",
@@ -98,7 +103,7 @@ static char **m680x_cpu_descriptions() {
98103

99104
RzAsmPlugin rz_asm_plugin_m680x_cs = {
100105
.name = "m680x",
101-
.cpus = "6800,6801,6805,6808,6809,6811,cpu12,6301,6309,hcs08",
106+
.cpus = "6800,6801,6802,6803,6805,6808,68HC08,6809,6811,cpu12,6301,6309,hcs08",
102107
.desc = "Motorola 680X Capstone-based disassembler",
103108
.license = "BSD",
104109
.arch = "m680x",

test/db/cmd/cmd_aL

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ ATTiny48 8-bit AVR microcontroller with 4KB Flash, 256B SRAM
143143
ATTiny88 8-bit AVR microcontroller with 8KB Flash, 512B SRAM
144144
6800 Motorola 6800: 8-bit microprocessor launched in 1974
145145
6801 Motorola 6801: Enhanced version of the 6800 with additional features like on-chip RAM and timers.
146+
6802 Motorola 6802: Enhanced version of the 6800 with 128 bytes of on-chip RAM and internal clock
147+
6803 Motorola 6803: Version of 6801 without internal ROM
146148
6805 Motorola 68HC05: 8-bit microcontroller
147149
6808 Motorola 6808: Variant of the 6800 microprocessor
150+
68HC08 Motorola 68HC08: 8-bit microcontroller (abbreviated as HC08)
148151
6809 Motorola 6809: Advanced 8-bit microprocessor
149152
6811 Motorola 68HC11: 8-bit microcontroller (also abbreviated as 6811 or HC11)
150153
cpu12 Motorola 68HC12: 16-bit microcontroller (also abbreviated as 6812 or HC12)

test/db/tools/rz_asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,11 @@ ATTiny48 8-bit AVR microcontroller with 4KB Flash, 256B SRAM
667667
ATTiny88 8-bit AVR microcontroller with 8KB Flash, 512B SRAM
668668
6800 Motorola 6800: 8-bit microprocessor launched in 1974
669669
6801 Motorola 6801: Enhanced version of the 6800 with additional features like on-chip RAM and timers.
670+
6802 Motorola 6802: Enhanced version of the 6800 with 128 bytes of on-chip RAM and internal clock
671+
6803 Motorola 6803: Version of 6801 without internal ROM
670672
6805 Motorola 68HC05: 8-bit microcontroller
671673
6808 Motorola 6808: Variant of the 6800 microprocessor
674+
68HC08 Motorola 68HC08: 8-bit microcontroller (abbreviated as HC08)
672675
6809 Motorola 6809: Advanced 8-bit microprocessor
673676
6811 Motorola 68HC11: 8-bit microcontroller (also abbreviated as 6811 or HC11)
674677
cpu12 Motorola 68HC12: 16-bit microcontroller (also abbreviated as 6812 or HC12)

0 commit comments

Comments
 (0)