- register struct areax *oxp;
- register int i;
- register char *ptr;
- int nmsym;
- Addr_T ai, aj;
- struct sym *sp;
- struct sym **p;
- int memPage;
-
- putc('\n', mfp);
-
- /*
- * Find number of symbols in area
- */
- nmsym = 0;
- oxp = xp->a_axp;
- while (oxp) {
- for (i=0; i<NHASH; i++) {
- sp = symhash[i];
- while (sp != NULL) {
- if (oxp == sp->s_axp)
- ++nmsym;
- sp = sp->s_sp;
- }
- }
- oxp = oxp->a_axp;
- }
- if (nmsym == 0) {
- return;
- }
-
- if (xflag == 0) {
- fprintf(mfp, "Hexadecimal\n\n");
- } else
- if (xflag == 1) {
- fprintf(mfp, "Octal\n\n");
- } else
- if (xflag == 2) {
- fprintf(mfp, "Decimal\n\n");
- }
- fprintf(mfp, "Area ");
- fprintf(mfp, "Addr Size Decimal %s (Attributes)\n",
- (xp->a_flag & A_BIT)?"Bits ":"Bytes");/* JCF: For BIT print bits...*/
- fprintf(mfp, "-------------------------------- ");
- fprintf(mfp, "---- ---- ------- ----- ------------\n");
- /*
- * Output Area Header
- */
- ptr = &xp->a_id[0];
- fprintf(mfp, "%-32s", ptr ); /* JLH: width matches --- above */
- ai = xp->a_addr;
- aj = xp->a_size;
- if (xflag == 0) {
- fprintf(mfp, " %04X %04X", ai, aj);
- } else
- if (xflag == 1) {
- fprintf(mfp, " %06o %06o", ai, aj);
- } else
- if (xflag == 2) {
- fprintf(mfp, " %05u %05u", ai, aj);
- }
- fprintf(mfp, " = %6u. %s ", aj,
- (xp->a_flag & A_BIT)?"bits ":"bytes"); /* JCF: For BIT print bits...*/
- if (xp->a_flag & A_ABS) {
- fprintf(mfp, "(ABS");
- } else {
- fprintf(mfp, "(REL");
- }
- if (xp->a_flag & A_OVR) {
- fprintf(mfp, ",OVR");
- } else {
- fprintf(mfp, ",CON");
- }
- if (xp->a_flag & A_PAG) {
- fprintf(mfp, ",PAG");
- }
-
- memPage = 0x00;
- if (xp->a_flag & A_CODE) {
- fprintf(mfp, ",CODE");
- memPage = 0x0C;
- }
- if (xp->a_flag & A_XDATA) {
- fprintf(mfp, ",XDATA");
- memPage = 0x0D;
- }
- if (xp->a_flag & A_BIT) {
- fprintf(mfp, ",BIT");
- memPage = 0x0B;
- }
- fprintf(mfp, ")");
- if (xp->a_flag & A_PAG) {
- ai = (ai & 0xFF);
- aj = (aj > 256);
- if (ai || aj) { fprintf(mfp, " "); }
- if (ai) { fprintf(mfp, " Boundary"); }
- if (ai & aj) { fprintf(mfp, " /"); }
- if (aj) { fprintf(mfp, " Length"); }
- if (ai || aj) { fprintf(mfp, " Error"); }
- }
-
- /*
- * Allocate space for an array of pointers to symbols
- * and load array.
- */
- if ( (p = (struct sym **) malloc(nmsym*sizeof(struct sym *)))
- == NULL) {
- fprintf(mfp, "\nInsufficient space to build Map Segment.\n");
- return;
- }
- nmsym = 0;
- oxp = xp->a_axp;
- while (oxp) {
- for (i=0; i<NHASH; i++) {
- sp = symhash[i];
- while (sp != NULL) {
- if (oxp == sp->s_axp) {
- p[nmsym++] = sp;
- }
- sp = sp->s_sp;
- }
- }
- oxp = oxp->a_axp;
- }
-
- qsort(p, nmsym, sizeof(struct sym *), _cmpSymByAddr);
-
- /*
- * Symbol Table Output
- */
-
- i = 0;
- fprintf(mfp, "\n\n");
- fprintf(mfp, " Value Global\n");
- fprintf(mfp, " -------- --------------------------------");
- while (i < nmsym) {
- fprintf(mfp, "\n");
- if (memPage != 0)
- fprintf(mfp, " %02X:", memPage);
- else
- fprintf(mfp, " ");
-
- sp = p[i];
- aj = sp->s_addr + sp->s_axp->a_addr;
- if (xflag == 0) {
- fprintf(mfp, "%04X ", aj);
- } else
- if (xflag == 1) {
- fprintf(mfp, "%06o ", aj);
- } else
- if (xflag == 2) {
- fprintf(mfp, "%05u ", aj);
- }
- ptr = &sp->s_id[0];
- fprintf(mfp, "%s", ptr );
-
- /* if cdb flag set the output cdb Information
- and the symbol has a '$' sign in it then */
- if (dflag &&
- strchr(ptr,'$'))
- fprintf(dfp,"L:%s:%X\n",ptr,aj);
-
- /* NoICE output of symbol */
- if (jflag) DefineNoICE( ptr, aj, memPage );
-
- i++;
- }
- putc('\n', mfp);
- free(p);
+ register struct areax *oxp;
+ register int i;
+ register char *ptr;
+ int nmsym;
+ Addr_T ai, aj;
+ struct sym *sp;
+ struct sym **p;
+ int memPage;
+
+ putc('\n', mfp);
+
+ /*
+ * Find number of symbols in area
+ */
+ nmsym = 0;
+ oxp = xp->a_axp;
+ while (oxp) {
+ for (i=0; i<NHASH; i++) {
+ sp = symhash[i];
+ while (sp != NULL) {
+ if (oxp == sp->s_axp)
+ ++nmsym;
+ sp = sp->s_sp;
+ }
+ }
+ oxp = oxp->a_axp;
+ }
+ if (nmsym == 0) {
+ return;
+ }
+
+ if (xflag == 0) {
+ fprintf(mfp, "Hexadecimal\n\n");
+ } else
+ if (xflag == 1) {
+ fprintf(mfp, "Octal\n\n");
+ } else
+ if (xflag == 2) {
+ fprintf(mfp, "Decimal\n\n");
+ }
+ fprintf(mfp, "Area ");
+ fprintf(mfp, "Addr Size Decimal %s (Attributes)\n",
+ (xp->a_flag & A_BIT)?"Bits ":"Bytes");/* JCF: For BIT print bits...*/
+ fprintf(mfp, "-------------------------------- ");
+ fprintf(mfp, "---- ---- ------- ----- ------------\n");
+ /*
+ * Output Area Header
+ */
+ ptr = &xp->a_id[0];
+ fprintf(mfp, "%-32s", ptr ); /* JLH: width matches --- above */
+ ai = xp->a_addr;
+ aj = xp->a_size;
+ if (xflag == 0) {
+ fprintf(mfp, " %04X %04X", ai, aj);
+ } else
+ if (xflag == 1) {
+ fprintf(mfp, " %06o %06o", ai, aj);
+ } else
+ if (xflag == 2) {
+ fprintf(mfp, " %05u %05u", ai, aj);
+ }
+ fprintf(mfp, " = %6u. %s ", aj,
+ (xp->a_flag & A_BIT)?"bits ":"bytes"); /* JCF: For BIT print bits...*/
+ if (xp->a_flag & A_ABS) {
+ fprintf(mfp, "(ABS");
+ } else {
+ fprintf(mfp, "(REL");
+ }
+ if (xp->a_flag & A_OVR) {
+ fprintf(mfp, ",OVR");
+ } else {
+ fprintf(mfp, ",CON");
+ }
+ if (xp->a_flag & A_PAG) {
+ fprintf(mfp, ",PAG");
+ }
+
+ memPage = 0x00;
+ if (xp->a_flag & A_CODE) {
+ fprintf(mfp, ",CODE");
+ memPage = 0x0C;
+ }
+ if (xp->a_flag & A_XDATA) {
+ fprintf(mfp, ",XDATA");
+ memPage = 0x0D;
+ }
+ if (xp->a_flag & A_BIT) {
+ fprintf(mfp, ",BIT");
+ memPage = 0x0B;
+ }
+ fprintf(mfp, ")");
+ if (xp->a_flag & A_PAG) {
+ ai = (ai & 0xFF);
+ aj = (aj > 256);
+ if (ai || aj) { fprintf(mfp, " "); }
+ if (ai) { fprintf(mfp, " Boundary"); }
+ if (ai & aj) { fprintf(mfp, " /"); }
+ if (aj) { fprintf(mfp, " Length"); }
+ if (ai || aj) { fprintf(mfp, " Error"); }
+ }
+
+ /*
+ * Allocate space for an array of pointers to symbols
+ * and load array.
+ */
+ if ( (p = (struct sym **) malloc(nmsym*sizeof(struct sym *)))
+ == NULL) {
+ fprintf(mfp, "\nInsufficient space to build Map Segment.\n");
+ return;
+ }
+ nmsym = 0;
+ oxp = xp->a_axp;
+ while (oxp) {
+ for (i=0; i<NHASH; i++) {
+ sp = symhash[i];
+ while (sp != NULL) {
+ if (oxp == sp->s_axp) {
+ p[nmsym++] = sp;
+ }
+ sp = sp->s_sp;
+ }
+ }
+ oxp = oxp->a_axp;
+ }
+
+ qsort(p, nmsym, sizeof(struct sym *), _cmpSymByAddr);
+
+ /*
+ * Symbol Table Output
+ */
+
+ i = 0;
+ fprintf(mfp, "\n\n");
+ fprintf(mfp, " Value Global\n");
+ fprintf(mfp, " -------- --------------------------------");
+ while (i < nmsym) {
+ fprintf(mfp, "\n");
+ if (memPage != 0)
+ fprintf(mfp, " %02X:", memPage);
+ else
+ fprintf(mfp, " ");
+
+ sp = p[i];
+ aj = sp->s_addr + sp->s_axp->a_addr;
+ if (xflag == 0) {
+ fprintf(mfp, "%04X ", aj);
+ } else
+ if (xflag == 1) {
+ fprintf(mfp, "%06o ", aj);
+ } else
+ if (xflag == 2) {
+ fprintf(mfp, "%05u ", aj);
+ }
+ ptr = &sp->s_id[0];
+ fprintf(mfp, "%s", ptr );
+
+ /* if cdb flag set the output cdb Information
+ and the symbol has a '$' sign in it then */
+ if (dflag &&
+ strchr(ptr,'$'))
+ fprintf(dfp,"L:%s:%X\n",ptr,aj);
+
+ /* NoICE output of symbol */
+ if (jflag) DefineNoICE( ptr, aj, memPage );
+
+ i++;
+ }
+ putc('\n', mfp);
+ free(p);