/* */
/* */
/* */
-/* (C) 2004 Ullrich von Bassewitz */
+/* (C) 2004-2006 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
CodeMark Mark1;
CodeMark Mark2;
token_t Tok; /* The operator token */
- type* EffType; /* Effective lhs type */
- type* ResultType; /* Type of the result */
+ Type* EffType; /* Effective lhs type */
+ Type* ResultType; /* Type of the result */
unsigned ExprBits; /* Bits of the lhs operand */
unsigned GenFlags; /* Generator flags */
unsigned ltype;
goto Next;
}
- /* If we're shifting an integer or unsigned to the left, the
+ /* If we're shifting an integer or unsigned to the right, the
* lhs has a const address, and the shift count is larger than 8,
* we can load just the high byte as a char with the correct
* signedness, and reduce the shift count by 8. If the remaining
* shift count is zero, we're done.
*/
- if (Tok == TOK_SHL &&
+ if (Tok == TOK_SHR &&
IsTypeInt (Expr->Type) &&
ED_IsLVal (Expr) &&
(ED_IsLocConst (Expr) || ED_IsLocStack (Expr)) &&
Expr2.IVal >= 8) {
- type* OldType;
+ Type* OldType;
/* Increase the address by one and decrease the shift count */
++Expr->IVal;
/* Remove the generated load code */
RemoveCode (&Mark1);
- /* Generate again code for the load */
+ /* Generate again code for the load, this time with the new type */
LoadExpr (CF_NONE, Expr);
/* Reset the type */
goto MakeRVal;
}
}
-
+
}
/* Generate code */