]> git.sur5r.net Git - cc65/commitdiff
Added CPU instruction set encoding
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 10 Oct 2003 17:38:21 +0000 (17:38 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 10 Oct 2003 17:38:21 +0000 (17:38 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2506 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/common/cpu.c
src/common/cpu.h

index 1d127bcc1d179e61cfc20f566fac6ad874036d02..33432d29f5b2c5c80ee140bbd377f52cdaa85675 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                   cpu.c                                 */
+/*                                   cpu.c                                   */
 /*                                                                           */
 /*                            CPU specifications                             */
 /*                                                                           */
@@ -58,6 +58,15 @@ const char* CPUNames[CPU_COUNT] = {
     "sunplus",
 };
 
+/* Tables with CPU instruction sets */
+const unsigned CPUIsets[CPU_COUNT] = {
+    CPU_ISET_6502,
+    CPU_ISET_6502 | CPU_ISET_65SC02,
+    CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02,
+    CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 | CPU_ISET_65816,
+    CPU_ISET_SUNPLUS
+};
+
 
 
 /*****************************************************************************/
index 187bef5ea050fa58793efa84262cb0c6024ebf27..f7347d30ce4a3286a316b689cd533aa6c452289f 100644 (file)
@@ -55,12 +55,24 @@ typedef enum {
     CPU_COUNT                          /* Number of different CPUs */
 } cpu_t;
 
+/* CPU instruction sets */
+enum {
+    CPU_ISET_6502       = 1 << CPU_6502,
+    CPU_ISET_65SC02     = 1 << CPU_65SC02,
+    CPU_ISET_65C02      = 1 << CPU_65C02,
+    CPU_ISET_65816      = 1 << CPU_65816,
+    CPU_ISET_SUNPLUS    = 1 << CPU_SUNPLUS
+};
+
 /* CPU used */
 extern cpu_t CPU;
 
-/* Table with target names */
+/* Table with CPU names */
 extern const char* CPUNames[CPU_COUNT];
 
+/* Table with CPU the instruction sets */
+extern const unsigned CPUIsets[CPU_COUNT];
+
 
 
 /*****************************************************************************/
@@ -78,7 +90,7 @@ cpu_t FindCPU (const char* Name);
 
 /* End of cpu.h */
 
-#endif                     
+#endif