X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Freginfo.h;h=ad49043d357683a56bfb48fbb34be126c6c62e44;hb=aef8789873bd008d42aa50330ca98488fad91b31;hp=9b2abc86658151ecae566e8743847eeb0bafc65f;hpb=0a9324d9c6b78c01bf57099ca26e1347d56e2e3d;p=cc65 diff --git a/src/cc65/reginfo.h b/src/cc65/reginfo.h index 9b2abc866..ad49043d3 100644 --- a/src/cc65/reginfo.h +++ b/src/cc65/reginfo.h @@ -44,11 +44,14 @@ /*****************************************************************************/ -/* 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 - +