From 9dad608bc99d819ad1c278e7e451252cedb46e8c Mon Sep 17 00:00:00 2001 From: cuz Date: Fri, 12 Dec 2003 16:02:30 +0000 Subject: [PATCH] Use the WORD0 expression op instead of AND git-svn-id: svn://svn.cc65.org/cc65/trunk@2732 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/expr.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) 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); } -- 2.39.5