projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
That was a little too efficient
[fw/sdcc]
/
src
/
SDCCglue.c
diff --git
a/src/SDCCglue.c
b/src/SDCCglue.c
index 75c40870403e09a3b6afb4ada19a4d72ef3579b4..59f82998c0ae74494db1f6ab87f58f442fff2a36 100644
(file)
--- a/
src/SDCCglue.c
+++ b/
src/SDCCglue.c
@@
-1229,7
+1229,7
@@
createInterruptVect (FILE * vFile)
/* only if the main function exists */
if (!(mainf = findSymWithLevel (SymbolTab, mainf)))
{
/* only if the main function exists */
if (!(mainf = findSymWithLevel (SymbolTab, mainf)))
{
- if (!options.cc_only && !noAssemble)
+ if (!options.cc_only && !noAssemble
&& !options.c1mode
)
werror (E_NO_MAIN);
return;
}
werror (E_NO_MAIN);
return;
}
@@
-1458,22
+1458,15
@@
glue (void)
/* now put it all together into the assembler file */
/* create the assembler file name */
/* now put it all together into the assembler file */
/* create the assembler file name */
- if (!options.c1mode)
+ /* -o option overrides default name? */
+ if ((noAssemble || options.c1mode) && fullDstFileName)
{
{
- /* -o option overrides default name? */
- if (noAssemble && fullDstFileName)
- {
- strcpy (scratchFileName, fullDstFileName);
- }
- else
- {
- strcpy (scratchFileName, dstFileName);
- strcat (scratchFileName, port->assembler.file_ext);
- }
+ strcpy (scratchFileName, fullDstFileName);
}
else
{
}
else
{
- strcpy (scratchFileName, options.out_name);
+ strcpy (scratchFileName, dstFileName);
+ strcat (scratchFileName, port->assembler.file_ext);
}
if (!(asmFile = fopen (scratchFileName, "w")))
}
if (!(asmFile = fopen (scratchFileName, "w")))
@@
-1513,7
+1506,8
@@
glue (void)
copyFile (asmFile, sfrbit->oFile);
/*JCF: Create the areas for the register banks*/
copyFile (asmFile, sfrbit->oFile);
/*JCF: Create the areas for the register banks*/
- if( TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_XA51 )
+ if(port->general.glue_up_main &&
+ (TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_XA51))
{
if(RegBankUsed[0]||RegBankUsed[1]||RegBankUsed[2]||RegBankUsed[3])
{
{
if(RegBankUsed[0]||RegBankUsed[1]||RegBankUsed[2]||RegBankUsed[3])
{
@@
-1633,7
+1627,7
@@
glue (void)
}
/* initialise the stack pointer. JCF: aslink takes care of the location */
}
/* 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");
fprintf (asmFile, "\tlcall\t__sdcc_external_startup\n");
fprintf (asmFile, "\tmov\ta,dpl\n");