]> git.sur5r.net Git - cc65/commitdiff
Added .charmap
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 18 Feb 2002 09:11:57 +0000 (09:11 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 18 Feb 2002 09:11:57 +0000 (09:11 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1163 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/pseudo.c
src/ca65/scanner.c
src/ca65/scanner.h

index 6e815c87a3748f7b23b2389414ef57a6d61b1bb4..e521fdbe97e74f411d02a808578ba0cc87bed876 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2000 Ullrich von Bassewitz                                       */
+/* (C) 1998-2002 Ullrich von Bassewitz                                       */
 /*               Wacholderweg 14                                             */
 /*               D-70597 Stuttgart                                           */
 /* EMail:        uz@musoftware.de                                            */
@@ -373,6 +373,37 @@ static void DoCase (void)
 
 
 
+static void DoCharMap (void)
+/* Allow custome character mappings */
+{
+    long Index;
+    long Code;
+
+    /* Read the index as numerical value */
+    Index = ConstExpression ();
+    if (Index < 1 || Index > 255) {
+       /* Value out of range */
+               ErrorSkip (ERR_RANGE);
+       return;
+    }
+
+    /* Comma follows */
+    ConsumeComma ();
+
+    /* Read the character code */
+    Code = ConstExpression ();
+    if (Code < 1 || Code > 255) {
+       /* Value out of range */
+               ErrorSkip (ERR_RANGE);
+       return;
+    }
+
+    /* Set the character translation */
+    TgtTranslateSet ((unsigned) Index, (unsigned char) Code);
+}
+
+
+
 static void DoCode (void)
 /* Switch to the code segment */
 {
@@ -1317,6 +1348,7 @@ static CtrlDesc CtrlCmdTab [] = {
     { ccNone,          DoBss           },
     { ccNone,          DoByte          },
     { ccNone,          DoCase          },
+    { ccNone,                  DoCharMap       },
     { ccNone,          DoCode          },
     { ccNone,          DoUnexpected,   },      /* .CONCAT */
     { ccNone,          DoConDes        },
index cdf81932a4227170aff2b637e3b305913a906657..05e6820d00ded7730de0686a17a2604e094b1a64 100644 (file)
@@ -133,6 +133,7 @@ struct DotKeyword {
     { ".BYT",          TOK_BYTE        },
     { ".BYTE",                 TOK_BYTE        },
     { ".CASE",         TOK_CASE        },
+    { ".CHARMAP",      TOK_CHARMAP     },
     { ".CODE",                 TOK_CODE        },
     { ".CONCAT",               TOK_CONCAT      },
     { ".CONDES",       TOK_CONDES      },
index f6fddc58810a36454fbd97592e8914ca7c9af63a..10a8c4e1d6dd6f6e757bebb53c1eab3a7d89b519 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2000 Ullrich von Bassewitz                                       */
+/* (C) 1998-2002 Ullrich von Bassewitz                                       */
 /*               Wacholderweg 14                                             */
 /*               D-70597 Stuttgart                                           */
 /* EMail:        uz@musoftware.de                                            */
@@ -118,9 +118,10 @@ enum Token {
     TOK_BLANK,
     TOK_BSS,
     TOK_BYTE,
-    TOK_CASE,
+    TOK_CASE,  
+    TOK_CHARMAP,
     TOK_CODE,
-    TOK_CONCAT,            
+    TOK_CONCAT,
     TOK_CONDES,
     TOK_CONST,
     TOK_CONSTRUCTOR,