From: cuz Date: Fri, 12 Dec 2003 16:02:30 +0000 (+0000) Subject: Use the WORD0 expression op instead of AND X-Git-Tag: V2.12.0~1072 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9dad608bc99d819ad1c278e7e451252cedb46e8c;p=cc65 Use the WORD0 expression op instead of AND git-svn-id: svn://svn.cc65.org/cc65/trunk@2732 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/expr.c b/src/ca65/expr.c index af3562b4f..417ca11cc 100644 --- a/src/ca65/expr.c +++ b/src/ca65/expr.c @@ -199,7 +199,7 @@ static int IsEasyConst (const ExprNode* E, long* Val) static ExprNode* LoByte (ExprNode* Operand) /* Return the low byte of the given expression */ { - ExprNode* Expr; + ExprNode* Expr; long Val; /* Special handling for const expressions */ @@ -1545,11 +1545,7 @@ ExprNode* GenByteExpr (ExprNode* Expr) /* Force the given expression into a byte and return the result */ { /* Use the low byte operator to force the expression into byte size */ - ExprNode* Root = NewExprNode (EXPR_BYTE0); - Root->Left = Expr; - - /* Return the result */ - return Root; + return LoByte (Expr); } @@ -1557,13 +1553,8 @@ ExprNode* GenByteExpr (ExprNode* Expr) ExprNode* GenWordExpr (ExprNode* Expr) /* Force the given expression into a word and return the result. */ { - /* AND the expression by $FFFF to force it into word size */ - ExprNode* Root = NewExprNode (EXPR_AND); - Root->Left = Expr; - Root->Right = GenLiteralExpr (0xFFFF); - - /* Return the result */ - return Root; + /* Use the low byte operator to force the expression into word size */ + return LoWord (Expr); }