]> git.sur5r.net Git - cc65/blobdiff - src/ca65/instr.c
More lineinfo usage.
[cc65] / src / ca65 / instr.c
index 89cdaf5e873fb3353e156af79bb606f096305151..39c32f2eadc91464c4ce2ba0a7ef04c88d52b2d4 100644 (file)
@@ -6,8 +6,8 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2006, Ullrich von Bassewitz                                      */
-/*                Römerstrasse 52                                            */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
 /*                                                                           */
@@ -39,7 +39,6 @@
 
 /* common */
 #include "addrsize.h"
-#include "assertdefs.h"
 #include "attrib.h"
 #include "bitops.h"
 #include "check.h"
@@ -490,9 +489,7 @@ static const struct {
                { "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 },
@@ -625,7 +622,7 @@ static const struct {
         { "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 },
     }
 };
 
@@ -1258,7 +1255,7 @@ static void PutTST (const InsDesc* Ins)
     EffAddr   A;
 
     /* The first argument is always an immediate byte */
-    if (Tok != TOK_HASH) {
+    if (CurTok.Tok != TOK_HASH) {
         ErrorSkip ("Invalid addressing mode");
         return;
     }
@@ -1453,7 +1450,7 @@ cpu_t GetCPU (void)
 
 
 
-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.
  */
@@ -1472,7 +1469,7 @@ int FindInstruction (const char* Ident)
 
     /* 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.
          */
@@ -1480,7 +1477,7 @@ int FindInstruction (const char* Ident)
             /* 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';