- /* create the idata segment */
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; indirectly addressable internal ram data\n");
- fprintf (asmFile, "%s", iComments2);
- copyFile (asmFile, idata->oFile);
-
- /* if external stack then reserve space of it */
- if (mainf && IFFUNC_HASBODY(mainf->type) && options.useXstack ) {
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; external stack \n");
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile,";\t.area XSEG (XDATA)\n"); /* MOF */
- fprintf (asmFile,";\t.ds 256\n");
- }
-
-
- /* copy xtern ram data */
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; external ram data\n");
- fprintf (asmFile, "%s", iComments2);
- copyFile (asmFile, xdata->oFile);
-
-
- /* copy the bit segment */
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; bit data\n");
- fprintf (asmFile, "%s", iComments2);
- copyFile (asmFile, bit->oFile);
-
-
- fprintf (asmFile, "\tORG 0\n");
-
- /* copy the interrupt vector table */
- if (mainf && IFFUNC_HASBODY(mainf->type)) {
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; interrupt vector \n");
- fprintf (asmFile, "%s", iComments2);
- copyFile (asmFile, vFile);
- }
-
- /* copy global & static initialisations */
- fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; global & static initialisations\n");
- fprintf (asmFile, "%s", iComments2);
-
- /* Everywhere we generate a reference to the static_name area,
- * (which is currently only here), we immediately follow it with a
- * definition of the post_static_name area. This guarantees that
- * the post_static_name area will immediately follow the static_name
- * area.
- */
- fprintf (asmFile, ";\t.area %s\n", port->mem.static_name); /* MOF */
- fprintf (asmFile, ";\t.area %s\n", port->mem.post_static_name);
- fprintf (asmFile, ";\t.area %s\n", port->mem.static_name);
-
- if (mainf && IFFUNC_HASBODY(mainf->type)) {
- fprintf (asmFile,"__sdcc_gsinit_startup:\n");
- /* if external stack is specified then the
- higher order byte of the xdatalocation is
- going into P2 and the lower order going into
- spx */
- if (options.useXstack) {
- fprintf(asmFile,";\tmov\tP2,#0x%02x\n",
- (((unsigned int)options.xdata_loc) >> 8) & 0xff);
- fprintf(asmFile,";\tmov\t_spx,#0x%02x\n",
- (unsigned int)options.xdata_loc & 0xff);