]> git.sur5r.net Git - cc65/blobdiff - src/cc65/opcodes.h
Fixed the CBM screen-code C header.
[cc65] / src / cc65 / opcodes.h
index fb9e3e53e32244b00e593cadb43e60b441c37a7a..0d191f6c7bd6b7337bd321d911a8fc5a994721fd 100644 (file)
@@ -1,13 +1,13 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                opcodes.h                                 */
+/*                                 opcodes.h                                 */
 /*                                                                           */
-/*                 Opcode and addressing mode definitions                   */
+/*                  Opcode and addressing mode definitions                   */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
 /* (C) 2001-2004 Ullrich von Bassewitz                                       */
-/*               Römerstraße 52                                              */
+/*               Roemerstrasse 52                                            */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
@@ -44,7 +44,7 @@
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
@@ -132,18 +132,18 @@ typedef enum {
 
 /* 65XX addressing modes */
 typedef enum {
-    AM65_IMP,                  /* implicit */
-    AM65_ACC,                  /* accumulator */
-    AM65_IMM,                  /* immidiate */
-    AM65_ZP,                   /* zeropage */
-    AM65_ZPX,                  /* zeropage,X */
+    AM65_IMP,                   /* implicit */
+    AM65_ACC,                   /* accumulator */
+    AM65_IMM,                   /* immediate */
+    AM65_ZP,                    /* zeropage */
+    AM65_ZPX,                   /* zeropage,X */
     AM65_ZPY,                   /* zeropage,Y */
-    AM65_ABS,                  /* absolute */
-    AM65_ABSX,                 /* absolute,X */
-    AM65_ABSY,                 /* absolute,Y */
-    AM65_ZPX_IND,                      /* (zeropage,x) */
-    AM65_ZP_INDY,                      /* (zeropage),y */
-    AM65_ZP_IND,               /* (zeropage) */
+    AM65_ABS,                   /* absolute */
+    AM65_ABSX,                  /* absolute,X */
+    AM65_ABSY,                  /* absolute,Y */
+    AM65_ZPX_IND,               /* (zeropage,x) */
+    AM65_ZP_INDY,               /* (zeropage),y */
+    AM65_ZP_IND,                /* (zeropage) */
     AM65_BRA                    /* branch */
 } am_t;
 
@@ -160,14 +160,14 @@ typedef enum {
 } bc_t;
 
 /* Opcode info */
-#define OF_NONE                0x0000U /* No additional information */
-#define OF_UBRA                0x0001U /* Unconditional branch */
-#define OF_CBRA                0x0002U /* Conditional branch */
-#define OF_ZBRA         0x0004U        /* Branch on zero flag condition */
+#define OF_NONE         0x0000U /* No additional information */
+#define OF_UBRA         0x0001U /* Unconditional branch */
+#define OF_CBRA         0x0002U /* Conditional branch */
+#define OF_ZBRA         0x0004U /* Branch on zero flag condition */
 #define OF_FBRA         0x0008U /* Branch on cond set by a load */
-#define OF_LBRA         0x0010U        /* Jump/branch is long */
-#define OF_RET                 0x0020U /* Return from function */
-#define OF_LOAD         0x0040U        /* Register load */
+#define OF_LBRA         0x0010U /* Jump/branch is long */
+#define OF_RET          0x0020U /* Return from function */
+#define OF_LOAD         0x0040U /* Register load */
 #define OF_STORE        0x0080U /* Register store */
 #define OF_XFR          0x0100U /* Transfer instruction */
 #define OF_CALL         0x0200U /* A subroutine call */
@@ -177,17 +177,17 @@ typedef enum {
 #define OF_NOIMP        0x2000U /* Implicit addressing mode is actually A */
 
 /* Combined infos */
-#define OF_BRA         (OF_UBRA | OF_CBRA)     /* Operation is a jump/branch */
-#define OF_DEAD        (OF_UBRA | OF_RET)      /* Dead end - no exec behind this point */
+#define OF_BRA  (OF_UBRA | OF_CBRA)     /* Operation is a jump/branch */
+#define OF_DEAD (OF_UBRA | OF_RET)      /* Dead end - no exec behind this point */
 
 /* Opcode description */
 typedef struct {
-    opc_t                  OPC;                /* Opcode */
-    char                   Mnemo[9];           /* Mnemonic */
-    unsigned char   Size;                      /* Size, 0 = check addressing mode */
-    unsigned short  Use;                       /* Registers used by this insn */
-    unsigned short  Chg;                       /* Registers changed by this insn */
-    unsigned short  Info;                      /* Additional information */
+    opc_t           OPC;                /* Opcode */
+    char            Mnemo[9];           /* Mnemonic */
+    unsigned char   Size;               /* Size, 0 = check addressing mode */
+    unsigned short  Use;                /* Registers used by this insn */
+    unsigned short  Chg;                /* Registers changed by this insn */
+    unsigned short  Info;               /* Additional information */
 } OPCDesc;
 
 /* Opcode description table */
@@ -196,15 +196,15 @@ extern const OPCDesc OPCTable[OP65_COUNT];
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
 
 const OPCDesc* FindOP65 (const char* OPC);
 /* Find the given opcode and return the opcode description. If the opcode was
- * not found, NULL is returned.
- */
+** not found, NULL is returned.
+*/
 
 unsigned GetInsnSize (opc_t OPC, am_t AM);
 /* Return the size of the given instruction */
@@ -217,7 +217,7 @@ INLINE const OPCDesc* GetOPCDesc (opc_t OPC)
     return &OPCTable [OPC];
 }
 #else
-#  define GetOPCDesc(OPC)      (&OPCTable [(OPC)])
+#  define GetOPCDesc(OPC)       (&OPCTable [(OPC)])
 #endif
 
 #if defined(HAVE_INLINE)
@@ -228,26 +228,26 @@ INLINE unsigned GetOPCInfo (opc_t OPC)
     return OPCTable[OPC].Info;
 }
 #else
-#  define GetOPCInfo(OPC)      (OPCTable[(OPC)].Info)
+#  define GetOPCInfo(OPC)       (OPCTable[(OPC)].Info)
 #endif
 
 unsigned char GetAMUseInfo (am_t AM);
 /* Get usage info for the given addressing mode (addressing modes that use
- * index registers return REG_r info for these registers).
- */
+** index registers return REG_r info for these registers).
+*/
 
 opc_t GetInverseBranch (opc_t OPC);
 /* Return a branch that reverse the condition of the branch given in OPC */
 
 opc_t MakeShortBranch (opc_t OPC);
 /* Return the short version of the given branch. If the branch is already
- * a short branch, return the opcode unchanged.
- */
+** a short branch, return the opcode unchanged.
+*/
 
 opc_t MakeLongBranch (opc_t OPC);
 /* Return the long version of the given branch. If the branch is already
- * a long branch, return the opcode unchanged.
- */
+** a long branch, return the opcode unchanged.
+*/
 
 bc_t GetBranchCond (opc_t OPC);
 /* Get the condition for the conditional branch in OPC */
@@ -258,7 +258,5 @@ bc_t GetInverseCond (bc_t BC);
 
 
 /* End of opcodes.h */
-#endif
-
-
 
+#endif