+/*
+ * Iterate over all memmaps and emit their contents (attributes, symbols).
+ */
+static void
+showAllMemmaps(FILE *of)
+{
+ struct dbuf_s locBuf;
+ memmap *maps[] = {
+ xstack, istack, code, data, pdata, xdata, xidata, xinit,
+ idata, bit, statsg, c_abs, x_abs, i_abs, d_abs,
+ sfr, sfrbit, reg, generic, overlay, eeprom, home };
+ memmap * map;
+ int i;
+
+ DEBUGprintf ("---begin memmaps---\n");
+ if (!extBuf) extBuf = dbuf_new(1024);
+ if (!gloBuf) gloBuf = dbuf_new(1024);
+ if (!gloDefBuf) gloDefBuf = dbuf_new(1024);
+ if (!ivalBuf) ivalBuf = dbuf_new(1024);
+ dbuf_init(&locBuf, 1024);
+
+ dbuf_printf (extBuf, "%s; external declarations\n%s", iComments2, iComments2);
+ dbuf_printf (gloBuf, "%s; global declarations\n%s", iComments2, iComments2);
+ dbuf_printf (gloDefBuf, "%s; global definitions\n%s", iComments2, iComments2);
+ dbuf_printf (ivalBuf, "%s; initialized data\n%s", iComments2, iComments2);
+ dbuf_printf (&locBuf, "%s; compiler-defined variables\n%s", iComments2, iComments2);
+
+ for (i = 0; i < sizeof(maps) / sizeof (memmap *); i++) {
+ map = maps[i];
+ //DEBUGprintf ("memmap %i: %p\n", i, map);
+ if (map) {
+#if 0
+ fprintf (stdout, "; pageno %c, sname %s, dbName %c, ptrType %d, slbl %d, sloc %u, fmap %u, paged %u, direct %u, bitsp %u, codesp %u, regsp %u, syms %p\n",
+ map->pageno, map->sname, map->dbName, map->ptrType, map->slbl,
+ map->sloc, map->fmap, map->paged, map->direct, map->bitsp,
+ map->codesp, map->regsp, map->syms);
+#endif
+ emitSymbolSet(map->syms, 0);
+ } // if (map)
+ } // for i
+ DEBUGprintf ("---end of memmaps---\n");
+
+ emitSymbolSet(publics, 1);
+ emitSymbolSet(externs, 2);
+
+ emitPseudoStack(gloBuf, extBuf);
+ pic14_constructAbsMap(gloDefBuf, gloBuf);
+ pic14printLocals (&locBuf);
+ pic14_emitConfigWord(of); // must be done after all the rest
+
+ dbuf_write_and_destroy(extBuf, of);
+ dbuf_write_and_destroy(gloBuf, of);
+ dbuf_write_and_destroy(gloDefBuf, of);
+ dbuf_write_and_destroy(&locBuf, of);
+ dbuf_write_and_destroy(ivalBuf, of);
+
+ extBuf = gloBuf = gloDefBuf = ivalBuf = NULL;