mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 06:30:16 +00:00
Generate LDY instead of INY whenever possible because this allows better
detection of known patterns and is replaced by INY in a later step anyway. git-svn-id: svn://svn.cc65.org/cc65/trunk@3098 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
08eb9b7b0e
commit
522f1d86d4
@ -481,7 +481,13 @@ static unsigned Opt_staxspidx (StackOpData* D)
|
||||
/* Inline the store */
|
||||
X = NewCodeEntry (OP65_STA, AM65_ZP_INDY, D->ZPLo, 0, D->OpEntry->LI);
|
||||
InsertEntry (D, X, D->OpIndex+1);
|
||||
X = NewCodeEntry (OP65_INY, AM65_IMP, 0, 0, D->OpEntry->LI);
|
||||
if (RegValIsKnown (D->OpEntry->RI->In.RegY)) {
|
||||
/* Value of Y is known */
|
||||
const char* Arg = MakeHexArg (D->OpEntry->RI->In.RegY + 1);
|
||||
X = NewCodeEntry (OP65_LDY, AM65_IMM, Arg, 0, D->OpEntry->LI);
|
||||
} else {
|
||||
X = NewCodeEntry (OP65_INY, AM65_IMP, 0, 0, D->OpEntry->LI);
|
||||
}
|
||||
InsertEntry (D, X, D->OpIndex+2);
|
||||
if (RegValIsKnown (D->OpEntry->RI->In.RegX)) {
|
||||
/* Value of X is known */
|
||||
|
Loading…
Reference in New Issue
Block a user