X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fcodeseg.c;h=fede7ae6215b12c694a0afd8668e9a77a752aefa;hb=73dfa23c987d8a7f1154801b85c171f9e01dcd58;hp=ab500eee2ee1cdab913f89cad3797335d7d940dd;hpb=1647c6783f98c7ca74f1f49a7f3eb3c60bdf95d0;p=cc65 diff --git a/src/cc65/codeseg.c b/src/cc65/codeseg.c index ab500eee2..fede7ae62 100644 --- a/src/cc65/codeseg.c +++ b/src/cc65/codeseg.c @@ -39,6 +39,7 @@ /* common */ #include "chartype.h" #include "check.h" +#include "debugflag.h" #include "global.h" #include "hashstr.h" #include "strutil.h" @@ -1281,9 +1282,21 @@ void CS_Output (const CodeSeg* S, FILE* F) /* Line info has changed, remember the new line info */ LI = E->LI; - /* Add the source line as a comment */ + /* Add the source line as a comment. Beware: When line continuation + * was used, the line may contain newlines. + */ if (AddSource) { - fprintf (F, ";\n; %s\n;\n", LI->Line); + const char* L = LI->Line; + fputs (";\n; ", F); + while (*L) { + if (*L == '\n') { + fputs ("\n; ", F); + } else { + fputc (*L, F); + } + ++L; + } + fputs ("\n;\n", F); } /* Add line debug info */ @@ -1391,19 +1404,22 @@ void CS_GenRegInfo (CodeSeg* S) break; } if (J->RI->Out2.RegA != Regs.RegA) { - Regs.RegA = -1; + Regs.RegA = UNKNOWN_REGVAL; } if (J->RI->Out2.RegX != Regs.RegX) { - Regs.RegX = -1; + Regs.RegX = UNKNOWN_REGVAL; } if (J->RI->Out2.RegY != Regs.RegY) { - Regs.RegY = -1; + Regs.RegY = UNKNOWN_REGVAL; } if (J->RI->Out2.SRegLo != Regs.SRegLo) { - Regs.SRegLo = -1; + Regs.SRegLo = UNKNOWN_REGVAL; } if (J->RI->Out2.SRegHi != Regs.SRegHi) { - Regs.SRegHi = -1; + Regs.SRegHi = UNKNOWN_REGVAL; + } + if (J->RI->Out2.Tmp1 != Regs.Tmp1) { + Regs.Tmp1 = UNKNOWN_REGVAL; } ++Entry; }