From: cuz Date: Thu, 18 Oct 2001 19:21:40 +0000 (+0000) Subject: New function RegAXUsed X-Git-Tag: V2.12.0~2539 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=564fbbe448cb9f338a7d6b18f841e8a014e26ed9;p=cc65 New function RegAXUsed git-svn-id: svn://svn.cc65.org/cc65/trunk@1060 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/codeinfo.c b/src/cc65/codeinfo.c index cd9b45438..896baaf21 100644 --- a/src/cc65/codeinfo.c +++ b/src/cc65/codeinfo.c @@ -534,5 +534,11 @@ int RegYUsed (struct CodeSeg* S, unsigned Index) +int RegAXUsed (struct CodeSeg* S, unsigned Index) +/* Check if the value in A or(!) the value in X are used. */ +{ + return (GetRegInfo (S, Index, REG_AX) & REG_AX) != 0; +} + diff --git a/src/cc65/codeinfo.h b/src/cc65/codeinfo.h index 435e49884..55a2e9c18 100644 --- a/src/cc65/codeinfo.h +++ b/src/cc65/codeinfo.h @@ -82,7 +82,7 @@ struct CodeSeg; #define REG_AY (REG_A | REG_Y) #define REG_XY (REG_X | REG_Y) #define REG_AXY (REG_AX | REG_Y) -#define REG_EAX (REG_AX | REG_SREG) +#define REG_EAX (REG_AX | REG_SREG) #define REG_EAXY (REG_EAX | REG_Y) #define REG_ZP 0xFFF8U #define REG_ALL 0xFFFFU @@ -131,6 +131,9 @@ int RegXUsed (struct CodeSeg* S, unsigned Index); int RegYUsed (struct CodeSeg* S, unsigned Index); /* Check if the value in Y is used. */ +int RegAXUsed (struct CodeSeg* S, unsigned Index); +/* Check if the value in A or(!) the value in X are used. */ + /* End of codeinfo.h */