]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codegen.c
Added .dbg statement generation for the assembler
[cc65] / src / cc65 / codegen.c
index ed60c9572a5b85ee6929770952e506adc47dde9f..add409b1d6e5de9f7bd87d9d99e025594cbf2df6 100644 (file)
@@ -143,32 +143,44 @@ void g_preamble (void)
     PushSegments (0);
 
     /* Identify the compiler version */
+    AddTextLine (";");
     AddTextLine ("; File generated by cc65 v %u.%u.%u",
                 VER_MAJOR, VER_MINOR, VER_PATCH);
+    AddTextLine (";");
 
     /* Insert some object file options */
-    AddTextLine (".fopt\t\tcompiler,\"cc65 v %u.%u.%u\"",
+    AddTextLine ("\t.fopt\t\tcompiler,\"cc65 v %u.%u.%u\"",
                    VER_MAJOR, VER_MINOR, VER_PATCH);
 
     /* If we're producing code for some other CPU, switch the command set */
     if (CPU == CPU_65C02) {
-       AddTextLine (".pc02");
+       AddTextLine ("\t.pc02");
     }
 
     /* Allow auto import for runtime library routines */
-    AddTextLine (".autoimport\ton");
+    AddTextLine ("\t.autoimport\ton");
 
     /* Switch the assembler into case sensitive mode */
-    AddTextLine (".case\t\ton");
+    AddTextLine ("\t.case\t\ton");
 
     /* Tell the assembler if we want to generate debug info */
-    AddTextLine (".debuginfo\t%s", (DebugInfo != 0)? "on" : "off");
+    AddTextLine ("\t.debuginfo\t%s", (DebugInfo != 0)? "on" : "off");
 
     /* Import the stack pointer for direct auto variable access */
-    AddTextLine (".importzp\tsp, sreg, regsave, regbank, tmp1, ptr1");
+    AddTextLine ("\t.importzp\tsp, sreg, regsave, regbank, tmp1, ptr1");
 
     /* Define long branch macros */
-    AddTextLine (".macpack\tlongbranch");
+    AddTextLine ("\t.macpack\tlongbranch");
+}
+
+
+
+void g_fileinfo (const char* Name, unsigned long Size, unsigned long MTime)
+/* If debug info is enabled, place a file info into the source */
+{
+    if (DebugInfo) {
+               AddTextLine ("\t.dbg\t\tfile, \"%s\", %lu, %lu", Name, Size, MTime);
+    }
 }