]> git.sur5r.net Git - cc65/commitdiff
New condes type interruptor
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 20 Sep 2004 10:15:01 +0000 (10:15 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 20 Sep 2004 10:15:01 +0000 (10:15 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3187 b7a2c559-68d2-44c3-8de9-860c34a00d81

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

index 3e0ecbb8e32a8ff7314a6020747fb19954fbf228..f68239bcd3984ea98ce3fc885efa208f0519e7df 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2003 Ullrich von Bassewitz                                       */
+/* (C) 1998-2004 Ullrich von Bassewitz                                       */
 /*               Römerstraße 52                                              */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
@@ -524,7 +524,8 @@ static void DoConDes (void)
 {
     static const char* Keys[] = {
                "CONSTRUCTOR",
-       "DESTRUCTOR",
+       "DESTRUCTOR", 
+        "INTERRUPTOR",
     };
     char Name [sizeof (SVal)];
     long Type;
@@ -567,7 +568,7 @@ static void DoConDes (void)
     /* Parse the remainder of the line and export the symbol */
     ConDes (Name, (unsigned) Type);
 }
-
+                      
 
 
 static void DoConstructor (void)
@@ -1098,6 +1099,25 @@ static void DoInclude (void)
 
 
 
+static void DoInterruptor (void)
+/* Export a symbol as interruptor */
+{
+    char Name [sizeof (SVal)];
+
+    /* Symbol name follows */
+    if (Tok != TOK_IDENT) {
+       ErrorSkip ("Identifier expected");
+       return;
+    }
+    strcpy (Name, SVal);
+    NextTok ();
+
+    /* Parse the remainder of the line and export the symbol */
+    ConDes (Name, CD_TYPE_INT);
+}
+
+
+
 static void DoInvalid (void)
 /* Handle a token that is invalid here, since it should have been handled on
  * a much lower level of the expression hierarchy. Getting this sort of token
@@ -1692,6 +1712,7 @@ static CtrlDesc CtrlCmdTab [] = {
     { ccNone,          DoImportZP      },
     { ccNone,          DoIncBin        },
     { ccNone,          DoInclude       },
+    { ccNone,           DoInterruptor   },
     { ccNone,          DoInvalid       },      /* .LEFT */
     { ccNone,          DoLineCont      },
     { ccNone,          DoList          },
index 1b87b78b4134980133de57f1966865f4ee15cad9..9b8a6dfc262cc6e3ddb4bddf0322b835efb9ee08 100644 (file)
@@ -200,6 +200,7 @@ struct DotKeyword {
     { ".IMPORTZP",     TOK_IMPORTZP    },
     { ".INCBIN",       TOK_INCBIN      },
     { ".INCLUDE",      TOK_INCLUDE     },
+    { ".INTERRUPTOR",   TOK_INTERRUPTOR },
     { ".LEFT",         TOK_LEFT        },
     { ".LINECONT",     TOK_LINECONT    },
     { ".LIST",         TOK_LIST        },
@@ -480,7 +481,7 @@ static void NextChar (void)
 
             /* For better handling of files with unusual line endings (DOS
              * files that are accidently translated on Unix for example),
-             * first remove all whitespace at the end, then add a single 
+             * first remove all whitespace at the end, then add a single
              * newline.
              */
             Len = strlen (IFile->Line);
index aa5cf6c7f867a05e061ba2ea9f611f0c30dfe07c..5c19a37f7e2ff6f42e5cc7f26c4a12fe475201a5 100644 (file)
@@ -189,11 +189,12 @@ enum Token {
     TOK_IMPORTZP,
     TOK_INCBIN,
     TOK_INCLUDE,
+    TOK_INTERRUPTOR,
     TOK_LEFT,
     TOK_LINECONT,
     TOK_LIST,
     TOK_LISTBYTES,
-    TOK_LOBYTE,
+    TOK_LOBYTE,     
     TOK_LOCAL,
     TOK_LOCALCHAR,
     TOK_LOWORD,
index 5d8717931fb229c665a3f98eb2f7013797aa508e..4b2c97be739e706dda6351c5b190e0c25124a787 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2000-2004 Ullrich von Bassewitz                                       */
+/*               Römerstraße 52                                              */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -60,6 +60,7 @@
 /* Predefined types */
 #define CD_TYPE_CON    0               /* Constructor */
 #define CD_TYPE_DES    1               /* Destructor */
+#define CD_TYPE_INT     2               /* Interruptor */
 
 /* When part of an export in an object file, type and priority are encoded in
  * one byte. In this case, the following macros access the fields: