X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Freginfo.h;h=ad49043d357683a56bfb48fbb34be126c6c62e44;hb=b821c2c8ae74aca5346429344034f3c5200e5570;hp=aac4c7c8159bdb5f5c742c7665e7d7676884b2ae;hpb=f38852df82b804f021c9a311a324fc3b0b74dbe7;p=cc65 diff --git a/src/cc65/reginfo.h b/src/cc65/reginfo.h index aac4c7c81..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 { @@ -57,6 +60,7 @@ struct RegContents { short RegY; short SRegLo; short SRegHi; + short Tmp1; }; /* Register change info */ @@ -81,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 @@ -92,8 +116,11 @@ void FreeRegInfo (RegInfo* RI); + + /* End of reginfo.h */ #endif +