* src/ds390/peeph.def: fix #123; add 14 rules by Fiorenzo D. Ramaglia <fd.ramaglia...
[fw/sdcc] / src / SDCCglue.c
index 45d374228148f75f9a0f1bed58d43e907d4508f8..99a4f959e75783ef63558396f92a3e873310b522 100644 (file)
@@ -1460,8 +1460,16 @@ glue (void)
 
   if (!options.c1mode)
     {
-      sprintf (scratchFileName, srcFileName);
+      /* -o option overrides default name? */
+      if (noAssemble && fullDstFileName)
+        {
+          strcpy (scratchFileName, fullDstFileName);
+        }
+      else
+        {
+          strcpy (scratchFileName, dstFileName);
       strcat (scratchFileName, port->assembler.file_ext);
+        }
     }
   else
     {
@@ -1625,7 +1633,7 @@ glue (void)
        }
 
       /* initialise the stack pointer.  JCF: aslink takes care of the location */
-       fprintf (asmFile, "\tmov\tsp,#__start__stack\n");       /* MOF */
+       fprintf (asmFile, "\tmov\tsp,#__start__stack - 1\n");   /* MOF */
 
       fprintf (asmFile, "\tlcall\t__sdcc_external_startup\n");
       fprintf (asmFile, "\tmov\ta,dpl\n");