+
/*****************************************************************************/
/* */
/* codeopt.c */
*
* and replace it by:
*
- * ldy xxx
+ * ldy xxx-2
* clc
* adc (sp),y
* bcc L
strcmp (E->Arg, "pushax") == 0 &&
CS_GetEntries (S, L, I+1, 5) &&
L[0]->OPC == OP65_LDY &&
+ CE_KnownImm (L[0]) &&
!CE_HasLabel (L[0]) &&
L[1]->OPC == OP65_LDX &&
CE_KnownImm (L[1]) &&
CodeEntry* X;
CodeLabel* Label;
+ char Buf [16];
/* Remove the call to pushax */
CS_DelEntry (S, I);
+ /* Correct the stack offset (needed since pushax was removed) */
+ L[0]->Num -= 2;
+ xsprintf (Buf, sizeof (Buf), "$%02lX", L[0]->Num);
+ CE_SetArg (L[0], Buf);
+
/* Add the clc . */
X = NewCodeEntry (OP65_CLC, AM65_IMP, 0, 0, L[3]->LI);
CS_InsertEntry (S, X, I+1);