From 5f8c0269d6d6905250ae0eadc4b95268555bc054 Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 10 Dec 2001 18:01:53 +0000 Subject: [PATCH] Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@1137 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/coptcmp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cc65/coptcmp.c b/src/cc65/coptcmp.c index a88e7047d..c185ecc27 100644 --- a/src/cc65/coptcmp.c +++ b/src/cc65/coptcmp.c @@ -670,17 +670,16 @@ unsigned OptCmp4 (CodeSeg* S) /* Change the code to just use the A register. Move the load * of the low byte after the first branch if possible: * - * ldy #o-1 + * ldy #o * lda (sp),y * cmp #a * bne L1 - * ldy #o + * ldy #o-1 * lda (sp),y * cmp #b * jne/jeq ... */ - sprintf (Buf, "$%02X", (int)(L[0]->Num-1)); - X = NewCodeEntry (OP65_LDY, AM65_IMM, Buf, 0, L[0]->LI); + X = NewCodeEntry (OP65_LDY, AM65_IMM, L[0]->Arg, 0, L[0]->LI); CS_InsertEntry (S, X, I+3); X = NewCodeEntry (OP65_LDA, AM65_ZP_INDY, "sp", 0, L[1]->LI); @@ -689,7 +688,8 @@ unsigned OptCmp4 (CodeSeg* S) X = NewCodeEntry (OP65_CMP, L[2]->AM, L[2]->Arg, 0, L[2]->LI); CS_InsertEntry (S, X, I+5); - X = NewCodeEntry (OP65_LDY, AM65_IMM, L[0]->Arg, 0, L[0]->LI); + sprintf (Buf, "$%02X", (int)(L[0]->Num-1)); + X = NewCodeEntry (OP65_LDY, AM65_IMM, Buf, 0, L[0]->LI); CS_InsertEntry (S, X, I+7); X = NewCodeEntry (OP65_LDA, AM65_ZP_INDY, "sp", 0, L[1]->LI); -- 2.39.5