Added the "none" CPU.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3592 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2005-08-26 12:46:44 +00:00
parent e016695787
commit a7476505a8
3 changed files with 44 additions and 26 deletions

View File

@@ -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 */
#define INS_COUNT_6502 56
static const struct {
@@ -575,6 +582,7 @@ static const struct {
/* An array with instruction tables */
static const InsTable* InsTabs[CPU_COUNT] = {
(const InsTable*) &InsTabNone,
(const InsTable*) &InsTab6502,
(const InsTable*) &InsTab6502X,
(const InsTable*) &InsTab65SC02,
@@ -1136,6 +1144,14 @@ int FindInstruction (const char* Ident)
const InsDesc* ID;
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 */
I = 0;
while (Ident[I] != '\0') {