/* */
/* */
/* */
-/* (C) 2001-2003 Ullrich von Bassewitz */
+/* (C) 2001-2004 Ullrich von Bassewitz */
/* Römerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
+static char* RegContentDesc (const RegContents* RC, char* Buf)
+/* Return a string containing register contents */
+{
+ char* B = Buf;
+
+ if (RegValIsUnknown (RC->RegA)) {
+ strcpy (B, "A:XX ");
+ } else {
+ sprintf (B, "A:%02X ", RC->RegA);
+ }
+ B += 5;
+ if (RegValIsUnknown (RC->RegX)) {
+ strcpy (B, "X:XX ");
+ } else {
+ sprintf (B, "X:%02X ", RC->RegX);
+ }
+ B += 5;
+ if (RegValIsUnknown (RC->RegY)) {
+ strcpy (B, "Y:XX");
+ } else {
+ sprintf (B, "Y:%02X", RC->RegY);
+ }
+ B += 4;
+
+ return Buf;
+}
+
+
+
void CE_Output (const CodeEntry* E, FILE* F)
/* Output the code entry to a file */
{
char Use [128];
char Chg [128];
fprintf (F,
- "%*s; USE: %-12s CHG: %-12s SIZE: %u\n",
+ "%*s; USE: %-12s CHG: %-12s SIZE: %u",
30-Chars, "",
- RegInfoDesc (E->Use, Use),
- RegInfoDesc (E->Chg, Chg),
+ RegInfoDesc (E->Use, Use),
+ RegInfoDesc (E->Chg, Chg),
E->Size);
- } else {
- /* Terminate the line */
- fprintf (F, "\n");
+
+ if (E->RI) {
+ char RegIn[32];
+ char RegOut[32];
+ fprintf (F,
+ " In %s Out %s",
+ RegContentDesc (&E->RI->In, RegIn),
+ RegContentDesc (&E->RI->Out, RegOut));
+ }
}
+
+ /* Terminate the line */
+ fprintf (F, "\n");
}
/* */
/* */
/* */
-/* (C) 2001-2003 Ullrich von Bassewitz */
+/* (C) 2001-2004 Ullrich von Bassewitz */
/* Römerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Attach this label to the code entry */
CE_AttachLabel (E, L);
- }
+ }
/* Return the label */
return L;
-void CS_Output (const CodeSeg* S, FILE* F)
+void CS_Output (CodeSeg* S, FILE* F)
/* Output the code segment data to a file */
{
unsigned I;
return;
}
+ /* Generate register info */
+ CS_GenRegInfo (S);
+
/* Output the segment directive */
fprintf (F, ".segment\t\"%s\"\n\n", S->SegName);
/* Add line debug info */
if (DebugInfo) {
fprintf (F, "\t.dbg\tline, \"%s\", %u\n",
- GetInputName (LI), GetInputLine (LI));
+ GetInputName (LI), GetInputLine (LI));
}
}
/* Output the code */
if (DebugInfo) {
fputs ("\t.dbg\tline\n", F);
}
+
+ /* Free register info */
+ CS_FreeRegInfo (S);
}
/* A is zero in one execution flow direction */
if (BC == BC_EQ) {
E->RI->Out2.RegA = 0;
- } else {
+ } else {
E->RI->Out.RegA = 0;
}
break;
E->RI->Out2.RegA = (unsigned char)P->Num;
} else {
E->RI->Out.RegA = (unsigned char)P->Num;
- }
+ }
}
break;
E->RI->Out2.RegX = 0;
} else {
E->RI->Out.RegX = 0;
- }
+ }
break;
case OP65_DEY:
/* */
/* */
/* */
-/* (C) 2001-2003 Ullrich von Bassewitz */
+/* (C) 2001-2004 Ullrich von Bassewitz */
/* Römerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
* assembler epilogue into the file. That is: Close the local function scope.
*/
-void CS_Output (const CodeSeg* S, FILE* F);
+void CS_Output (CodeSeg* S, FILE* F);
/* Output the code segment data to a file */
void CS_FreeRegInfo (CodeSeg* S);