/* */
/* */
/* */
-/* (C) 1998-2006, Ullrich von Bassewitz */
-/* Römerstrasse 52 */
+/* (C) 1998-2011, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* common */
#include "addrsize.h"
-#include "assertdefs.h"
#include "attrib.h"
#include "bitops.h"
#include "check.h"
{ "BCC", 0x0020000, 0x90, 0, PutPCRel8 },
{ "BCS", 0x0020000, 0xb0, 0, PutPCRel8 },
{ "BEQ", 0x0020000, 0xf0, 0, PutPCRel8 },
- { "BGE", 0x0020000, 0xb0, 0, PutPCRel8 }, /* == BCS */
{ "BIT", 0x0a0006c, 0x00, 2, PutAll },
- { "BLT", 0x0020000, 0x90, 0, PutPCRel8 }, /* == BCC */
{ "BMI", 0x0020000, 0x30, 0, PutPCRel8 },
{ "BNE", 0x0020000, 0xd0, 0, PutPCRel8 },
{ "BPL", 0x0020000, 0x10, 0, PutPCRel8 },
{ "ST", AMSW16_REG | AMSW16_IND, 0x10, 1, PutSweet16 },
{ "STD", AMSW16_IND, 0x70, 0, PutSweet16 },
{ "STP", AMSW16_IND, 0x90, 0, PutSweet16 },
- { "SUB", AMSW16_IMM, 0xB0, 0, PutSweet16 },
+ { "SUB", AMSW16_REG, 0xB0, 0, PutSweet16 },
}
};
EffAddr A;
/* The first argument is always an immediate byte */
- if (Tok != TOK_HASH) {
+ if (CurTok.Tok != TOK_HASH) {
ErrorSkip ("Invalid addressing mode");
return;
}
-int FindInstruction (const char* Ident)
+int FindInstruction (const StrBuf* Ident)
/* Check if Ident is a valid mnemonic. If so, return the index in the
* instruction table. If not, return -1.
*/
/* Make a copy, and uppercase that copy */
I = 0;
- while (Ident[I] != '\0') {
+ while (I < SB_GetLen (Ident)) {
/* If the identifier is longer than the longest mnemonic, it cannot
* be one.
*/
/* Not found, no need for further action */
return -1;
}
- Key[I] = toupper ((unsigned char)Ident[I]);
+ Key[I] = toupper ((unsigned char)SB_AtUnchecked (Ident, I));
++I;
}
Key[I] = '\0';