1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-01 00:57:11 +00:00

Fixed a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@89 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-06-20 06:53:01 +00:00
parent ea2f5c1309
commit dff9bae70a

View File

@ -1872,14 +1872,10 @@ static int OptPtrOps1 (Line** Start)
}
/* Check if AX is actually used following the code above. If not,
* we don't need to load A/X from regsave. Since X will never by
* we don't need to load A/X from regsave. Since X will never be
* used without A, check just for A.
*/
NeedLoad = 1;
if (!RegAUsed (L3[3])) {
/* We don't need to load regsave */
NeedLoad = 0;
}
NeedLoad = RegAUsed (L3[3]);
/* Special code for register variables */
Done = 0;
@ -2042,8 +2038,8 @@ static int OptPtrOps1 (Line** Start)
/* If we need to load a/x, add the code */
if (NeedLoad) {
L = NewLineAfter (L, "\ttax");
L = NewLineAfter (L, "\tlda\tptr1");
L = NewLineAfter (L, "\tldx\tptr1+1");
}
}
@ -2157,11 +2153,7 @@ static int OptPtrOps2 (Line** Start)
* we don't need to load A/X from regsave. Since X will never by
* used without A, check just for A.
*/
NeedLoad = 1;
if (!RegAUsed (L3[0])) {
/* We don't need to load regsave */
NeedLoad = 0;
}
NeedLoad = RegAUsed (L3[0]);
/* Replace the ldy instruction, offset must point to the low byte */
sprintf (L->Line+7, "%02X", Offs);
@ -2251,8 +2243,8 @@ static int OptPtrOps2 (Line** Start)
/* If we need to load a/x, add the code */
if (NeedLoad) {
L = NewLineAfter (L, "\ttax");
L = NewLineAfter (L, "\tlda\tptr1");
L = NewLineAfter (L, "\tldx\tptr1+1");
}
/* Remove the code that is no longer needed */