1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 21:29:03 +00:00

Fixed optimizer bug in or/xor

git-svn-id: svn://svn.cc65.org/cc65/trunk@1425 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-10-02 22:21:42 +00:00
parent b4326d1930
commit f5243e514c

View File

@ -403,7 +403,7 @@ static unsigned Opt_tosorax (CodeSeg* S, unsigned Push, unsigned Or,
X = NewCodeEntry (OP65_STX, AM65_ZP, ZPHi, 0, PushEntry->LI);
CS_InsertEntry (S, X, Push+1);
++Or; /* Correct the index */
if (DirectOr) {
if (!DirectOr) {
X = NewCodeEntry (OP65_STA, AM65_ZP, ZPLo, 0, PushEntry->LI);
CS_InsertEntry (S, X, Push+1);
++Or; /* Correct the index */
@ -471,13 +471,13 @@ static unsigned Opt_tosxorax (CodeSeg* S, unsigned Push, unsigned Xor,
* value in the zero page location.
*/
DirectXor = (P->OPC == OP65_LDA &&
(P->AM == AM65_IMM || P->AM == AM65_ZP || P->AM == AM65_ABS));
(P->AM == AM65_IMM || P->AM == AM65_ZP || P->AM == AM65_ABS));
/* Store the value into the zeropage instead of pushing it */
X = NewCodeEntry (OP65_STX, AM65_ZP, ZPHi, 0, PushEntry->LI);
CS_InsertEntry (S, X, Push+1);
++Xor; /* Correct the index */
if (DirectXor) {
if (!DirectXor) {
X = NewCodeEntry (OP65_STA, AM65_ZP, ZPLo, 0, PushEntry->LI);
CS_InsertEntry (S, X, Push+1);
++Xor; /* Correct the index */