Added the "none" CPU.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3592 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -83,6 +83,13 @@ static void PutSweet16Branch (const InsDesc* Ins);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Empty instruction table */
|
||||||
|
static const struct {
|
||||||
|
unsigned Count;
|
||||||
|
} InsTabNone = {
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
/* Instruction table for the 6502 */
|
/* Instruction table for the 6502 */
|
||||||
#define INS_COUNT_6502 56
|
#define INS_COUNT_6502 56
|
||||||
static const struct {
|
static const struct {
|
||||||
@@ -575,6 +582,7 @@ static const struct {
|
|||||||
|
|
||||||
/* An array with instruction tables */
|
/* An array with instruction tables */
|
||||||
static const InsTable* InsTabs[CPU_COUNT] = {
|
static const InsTable* InsTabs[CPU_COUNT] = {
|
||||||
|
(const InsTable*) &InsTabNone,
|
||||||
(const InsTable*) &InsTab6502,
|
(const InsTable*) &InsTab6502,
|
||||||
(const InsTable*) &InsTab6502X,
|
(const InsTable*) &InsTab6502X,
|
||||||
(const InsTable*) &InsTab65SC02,
|
(const InsTable*) &InsTab65SC02,
|
||||||
@@ -1136,6 +1144,14 @@ int FindInstruction (const char* Ident)
|
|||||||
const InsDesc* ID;
|
const InsDesc* ID;
|
||||||
char Key[sizeof (ID->Mnemonic)];
|
char Key[sizeof (ID->Mnemonic)];
|
||||||
|
|
||||||
|
/* Shortcut for the "none" CPU: If there are no instructions to search
|
||||||
|
* for, bail out early.
|
||||||
|
*/
|
||||||
|
if (InsTab->Count == 0) {
|
||||||
|
/* Not found */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make a copy, and uppercase that copy */
|
/* Make a copy, and uppercase that copy */
|
||||||
I = 0;
|
I = 0;
|
||||||
while (Ident[I] != '\0') {
|
while (Ident[I] != '\0') {
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
|
|
||||||
; CPU bitmask constants
|
; CPU bitmask constants
|
||||||
CPU_ISET_6502 = $01
|
CPU_ISET_NONE = $01
|
||||||
CPU_ISET_6502X = $02
|
CPU_ISET_6502 = $02
|
||||||
CPU_ISET_65SC02 = $04
|
CPU_ISET_6502X = $04
|
||||||
CPU_ISET_65C02 = $08
|
CPU_ISET_65SC02 = $08
|
||||||
CPU_ISET_65816 = $10
|
CPU_ISET_65C02 = $10
|
||||||
CPU_ISET_SUNPLUS = $20
|
CPU_ISET_65816 = $20
|
||||||
CPU_ISET_SWEET16 = $40
|
CPU_ISET_SUNPLUS = $40
|
||||||
|
CPU_ISET_SWEET16 = $80
|
||||||
|
|
||||||
; CPU capabilities
|
; CPU capabilities
|
||||||
|
CPU_NONE = CPU_ISET_NONE
|
||||||
CPU_6502 = CPU_ISET_6502
|
CPU_6502 = CPU_ISET_6502
|
||||||
CPU_6502X = CPU_ISET_6502|CPU_ISET_6502X
|
CPU_6502X = CPU_ISET_6502|CPU_ISET_6502X
|
||||||
CPU_65SC02 = CPU_ISET_6502|CPU_ISET_65SC02
|
CPU_65SC02 = CPU_ISET_6502|CPU_ISET_65SC02
|
||||||
|
|||||||
Reference in New Issue
Block a user