if (SPEC_STRUCT (type)->type == UNION) {
printIval (sym, sflds->type, iloop, oBuf);
- iloop = iloop->next;
+ iloop = iloop ? iloop->next : NULL;
} else {
for (; sflds; sflds = sflds->next, iloop = (iloop ? iloop->next : NULL)) {
if (IS_BITFIELD(sflds->type)) {
char *iComments1 =
{
";--------------------------------------------------------\n"
- "; File Created by SDCC : FreeWare ANSI-C Compiler\n"};
+ "; File Created by SDCC : free open source ANSI-C Compiler\n"};
char *iComments2 =
{
time_t t;
time (&t);
fprintf (afile, "%s", iComments1);
- fprintf (afile, "; Version " SDCC_VERSION_STR " #%s (%s)\n", getBuildNumber(), __DATE__);
- fprintf (afile, "; This file generated %s", asctime (localtime (&t)));
+ fprintf (afile, "; Version " SDCC_VERSION_STR " #%s (%s) (%s)\n",
+ getBuildNumber(), __DATE__, getBuildEnvironment());
+ fprintf (afile, "; This file was generated %s", asctime (localtime (&t)));
fprintf (afile, "%s", iComments2);
}
fprintf (asmFile, "\tmov\tsp,#__start__stack - 1\n"); /* MOF */
}
- fprintf (asmFile, "\tlcall\t__sdcc_external_startup\n");
+ fprintf (asmFile, "\t%ccall\t__sdcc_external_startup\n", options.acall_ajmp?'a':'l');
fprintf (asmFile, "\tmov\ta,dpl\n");
fprintf (asmFile, "\tjz\t__sdcc_init_data\n");
- fprintf (asmFile, "\tljmp\t__sdcc_program_startup\n");
+ fprintf (asmFile, "\t%cjmp\t__sdcc_program_startup\n", options.acall_ajmp?'a':'l');
fprintf (asmFile, "__sdcc_init_data:\n");
// if the port can copy the XINIT segment to XISEG
* by the ugly shucking and jiving about 20 lines ago.
*/
tfprintf (asmFile, "\t!area\n", port->mem.post_static_name);
- fprintf (asmFile, "\tljmp\t__sdcc_program_startup\n");
+ fprintf (asmFile, "\t%cjmp\t__sdcc_program_startup\n", options.acall_ajmp?'a':'l');
}
fprintf (asmFile,
/* put in jump or call to main */
if (options.mainreturn)
{
- fprintf (asmFile, "\tljmp\t_main\n"); /* needed? */
+ fprintf (asmFile, "\t%cjmp\t_main\n", options.acall_ajmp?'a':'l'); /* needed? */
fprintf (asmFile, ";\treturn from main will return to caller\n");
}
else
{
- fprintf (asmFile, "\tlcall\t_main\n");
+ fprintf (asmFile, "\t%ccall\t_main\n", options.acall_ajmp?'a':'l');
fprintf (asmFile, ";\treturn from main will lock up\n");
fprintf (asmFile, "\tsjmp .\n");
}