]> git.sur5r.net Git - cc65/blobdiff - src/cc65/reginfo.h
Allow any number of optional braces around all initializers as required by the standard
[cc65] / src / cc65 / reginfo.h
index 9b2abc86658151ecae566e8743847eeb0bafc65f..ad49043d357683a56bfb48fbb34be126c6c62e44 100644 (file)
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                  Data                                    */
 /*****************************************************************************/
 
 
 
+/* Encoding for an unknown register value */
+#define UNKNOWN_REGVAL  -1
+
 /* Register contents */
 typedef struct RegContents RegContents;
 struct RegContents {
@@ -82,6 +85,26 @@ void RC_Invalidate (RegContents* C);
 void RC_InvalidateZP (RegContents* C);
 /* Invalidate all ZP registers */
 
+#if defined(HAVE_INLINE)
+INLINE int RegValIsKnown (short Val)
+/* Return true if the register value is known */
+{
+    return (Val >= 0);
+}
+#else
+#  define RegValIsKnown(S)      ((S) >= 0)
+#endif
+
+#if defined(HAVE_INLINE)
+INLINE int RegValIsUnknown (short Val)
+/* Return true if the register value is not known */
+{
+    return (Val < 0);
+}
+#else
+#  define RegValIsUnknown(S)      ((S) < 0)
+#endif
+
 RegInfo* NewRegInfo (const RegContents* RC);
 /* Allocate a new register info, initialize and return it. If RC is not
  * a NULL pointer, it is used to initialize both, the input and output
@@ -93,9 +116,11 @@ void FreeRegInfo (RegInfo* RI);
 
 
 
+
+
 /* End of reginfo.h */
 #endif
 
 
 
-                   
+