-SCCSID = "@(#)Makefile 1.1 %G%"
+SCCSID = "@(#)Makefile 1.2 %G%"
-CFLAGS = -O -DVAX -DOBJ
+CFLAGS = -O
+DEFS = -DVAX -DOBJ
DESTDIR =/usr/ucb
LIBDIR =/usr/lib
PASCALDIR = /usr/src/cmd/pascal
AS = as
RM = rm -f
-PXHDR = ${PASCALDIR}/OPnames.h ${PASCALDIR}/objfmt.h\
- ${LIBPCDIR}/libpc.h ${LIBPCDIR}/h01errs.h\
- newvars.h machdep.h
+PSHDR = OPnames.h objfmt.h opc.c pic.c
+PCHDR = libpc.h h01errs.h
+
+PXHDR = vars.h machdep.h
PXSRC = int.c interp.c except.c utilities.c
PXOBJ = int.o interp.o except.o utilities.o
-PXUTL = ${PASCALDIR}/opc.c ${PASCALDIR}/pic.c ${PASCALDIR}/version.c\
- make.ed1 panics interp.sed clean.sed
+PXUTL = make.ed1 panics interp.sed clean.sed version.c
sources: ${PXHDR} ${PXSRC} ${PXUTL}
-${PXHDR} ${PXUTL}:
- cp $@ .
+${PSHDR}:
+ cp ${PASCALDIR}/$@ $@
+${PCHDR}:
+ cp ${LIBPCDIR}/$@ $@
+
+.c.o:
+ ${CC} ${CFLAGS} ${DEFS} -c $*.c
px: Version.c ${PXOBJ}
- ${CC} -O -o px Version.c ${PXOBJ} /usr/src/lib/libpc/pclib -lm
-Version.c: ${PASCALDIR}/version.c
- ${CC} -o version ${PASCALDIR}/version.c
+ ${CC} ${CFLAGS} -o px Version.c ${PXOBJ} /usr/src/lib/libpc/libpc -lm
+Version.c: version.c
+ ${CC} ${CFLAGS} -o version version.c
./version >Version.c
${RM} version
interp.o interp.s: interp.c
- ${CC} -S interp.c
+ ${CC} ${DEFS} -S interp.c
sed -f interp.sed <interp.s >tmp
+ /usr/lib/pc2 <tmp >interp.s
+ /lib/c2 interp.s tmp
mv tmp interp.s
as -o interp.o interp.s
panics.h: panics make.ed1
ex - <make.ed1
-h02opcs.h: ${PASCALDIR}/OPnames.h ${PASCALDIR}/opc.c
- ${CC} ${PASCALDIR}/opc.c -o opc
+h02opcs.h: OPnames.h opc.c
+ ${CC} ${CFLAGS} opc.c -o opc
./opc >h02opcs.h
${RM} opc
grind: sources
@vpr READ_ME makefile
- @${CC} -o pic pic.c
+ @${CC} ${CFLAGS} -o pic pic.c
@./pic | vpr
- @/usr/ucb/vgrind newvars.h objfmt.h machdep.h
+ @/usr/ucb/vgrind vars.h objfmt.h machdep.h
@/usr/ucb/vgrind ${PXSRC}
@${RM} pic*
# DO NOT DELETE THIS LINE -- make depend uses it
# DEPENDENCIES MUST END AT END OF FILE
except.o: panics.h
-int.o: newvars.h
+except.o: vars.h
+int.o: vars.h
int.o: objfmt.h
-interp.o: newvars.h
+interp.o: vars.h
interp.o: panics.h
interp.o: h02opcs.h
interp.o: machdep.h
+interp.o: h01errs.h
interp.o: libpc.h
-opc.o: OPnames.h
-panic.o: newvars.h
-panic.o: panics.h
-pic.o: OPnames.h
-stats.o: newvars.h
-utilities.o: newvars.h
+utilities.o: vars.h
utilities.o: panics.h
utilities.o: h02opcs.h
# DEPENDENCIES MUST END AT END OF FILE
/* Copyright (c) 1979 Regents of the University of California */
-static char sccsid[] = "@(#)interp.c 1.1 %G%";
+static char sccsid[] = "@(#)interp.c 1.2 %G%";
#include <math.h>
#include "vars.h"
#include "h01errs.h"
#include "libpc.h"
-/* debugging variables */
-char opc[10];
-long opcptr = 9;
-
/*
* program variables
*/
-struct disp _display[MAXLVL];
+union disply _display;
struct disp *_dp;
long _lino = 0;
int _argc;
1 /* fsize */
};
+/*
+ * Px profile array
+ */
+#ifdef PROFILE
+long _profcnts[NUMOPS];
+#endif PROFILE
+
+/*
+ * debugging variables
+ */
+#ifdef DEBUG
+char opc[10];
+long opcptr = 9;
+#endif DEBUG
+\f
interpreter(base)
char *base;
{
/*
* set up global environment, then ``call'' the main program
*/
- _display[0].locvars = pushsp(2 * sizeof(struct iorec *));
- *(struct iorec **)(_display[0].locvars + 4) = OUTPUT;
- *(struct iorec **)(_display[0].locvars) = INPUT;
- _display[0].locvars += 8; /* >>> kludge <<< */
- asm(" bispsw $0xe0"); /* enable overflow traps */
+ _display.frame[0].locvars = pushsp(2 * sizeof(struct iorec *));
+ _display.frame[0].locvars += 8; /* local offsets are negative */
+ *(struct iorec **)(_display.frame[0].locvars - 4) = OUTPUT;
+ *(struct iorec **)(_display.frame[0].locvars - 8) = INPUT;
+ enableovrflo();
stp = (struct stack *)pushsp(sizeof(struct stack));
- _dp = &_display[0];
+ _dp = &_display.frame[0];
pc.cp = base;
for(;;) {
+# ifdef DEBUG
if (++opcptr == 10)
opcptr = 0;
opc[opcptr] = *pc.ucp;
+# endif DEBUG
+# ifdef PROFILE
+ _profcnts[*pc.ucp]++;
+# endif PROFILE
switch (*pc.ucp++) {
default:
panic(PBADOP);
continue;
case O_NODUMP:
_nodump++;
- asm(" bicpsw $0xe0");/* disable overflow checks */
+ disableovrflo();
/* and fall through */
case O_BEG:
_dp += 1; /* enter local scope */
stp->odisp = *_dp; /* save old display value */
tl = *pc.ucp++; /* tl = name size */
stp->entry = pc.hdrp; /* pointer to entry info */
- tl1 = -*pc.lp++; /* tl1 = local variable size */
+ tl1 = *pc.lp++; /* tl1 = local variable size */
pc.lp++; /* skip over number of args */
_lino = *pc.usp++; /* set new lino */
pc.cp += tl; /* skip over name text */
stp->file = curfile; /* save active file */
tcp = pushsp(tl1); /* tcp = new top of stack */
blkclr(tl1, tcp); /* zero stack frame */
+ tcp += tl1; /* offsets of locals are neg */
+ _dp->locvars = tcp; /* set new display pointer */
+ _dp->stp = stp;
stp->tos = pushsp(0); /* set top of stack pointer */
- _dp->stp = stp; /* set new display pointer */
- /* _dp->locvars = tcp; */
- _dp->locvars = (char *)stp; /* kludge, use prev line */
continue;
case O_END:
PCLOSE(_dp->locvars); /* flush & close local files */
stp = _dp->stp;
curfile = stp->file; /* restore old active file */
*_dp = stp->odisp; /* restore old display entry */
- if (_dp == &_display[1])
+ if (_dp == &_display.frame[1])
return; /* exiting main proc ??? */
_lino = stp->lino; /* restore lino, pc, dp */
pc.cp = stp->pc.cp;
_dp = stp->dp;
- popsp(-stp->entry->framesze + /* pop local vars */
+ popsp(stp->entry->framesze + /* pop local vars */
sizeof(struct stack) + /* pop stack frame */
stp->entry->nargs); /* pop parms */
continue;
stp->lino = _lino; /* save lino, pc, dp */
stp->pc.cp = pc.cp;
stp->dp = _dp;
- _dp = &_display[tl]; /* set up new display ptr */
+ _dp = &_display.frame[tl]; /* set up new display ptr */
pc.cp = tcp;
continue;
case O_FCALL:
tl -= sizeof(int) - 1;
ERROR(ENARGS, tl / sizeof(int));
}
- _dp = &_display[tfp->cbn];/* set up new display ptr */
+ _dp = &_display.frame[tfp->cbn];/* new display ptr */
blkcpy(sizeof(struct disp) * tfp->cbn,
- &_display[1], &tfp->disp[tfp->cbn]);
+ &_display.frame[1], &tfp->disp[tfp->cbn]);
blkcpy(sizeof(struct disp) * tfp->cbn,
- &tfp->disp[0], &_display[1]);
+ &tfp->disp[0], &_display.frame[1]);
continue;
case O_FRTN:
tl = *pc.cp++; /* tl = size of return obj */
blkcpy(tl, tcp, tcp + sizeof(struct formalrtn *));
popsp(sizeof(struct formalrtn *));
blkcpy(sizeof(struct disp) * tfp->cbn,
- &tfp->disp[tfp->cbn], &_display[1]);
+ &tfp->disp[tfp->cbn], &_display.frame[1]);
continue;
case O_FSAV:
tfp = (struct formalrtn *)popaddr();
tcp += sizeof(short);
tfp->entryaddr = base + *(long *)tcp;
blkcpy(sizeof(struct disp) * tfp->cbn,
- &_display[1], &tfp->disp[0]);
+ &_display.frame[1], &tfp->disp[0]);
pushaddr(tfp);
continue;
case O_SDUP2:
pc.cp = base + *pc.lp;
continue;
case O_GOTO:
- tstp = _display[*pc.cp++].stp; /* ptr to exit frame */
+ tstp = _display.frame[*pc.cp++].stp; /* ptr to
+ exit frame */
pc.cp = base + *pc.lp;
stp = _dp->stp;
while (tstp != stp) {
- if (_dp == &_display[1])
+ if (_dp == &_display.frame[1])
ERROR(EGOTO); /* exiting prog ??? */
PCLOSE(_dp->locvars); /* close local files */
curfile = stp->file; /* restore active file */
tl = *pc.usp++;
tl1 = pop2(); /* index */
tl2 = *pc.sp++;
- SUBSC(tl1, tl2, tl2 + *pc.usp++); /* range check */
+ SUBSC(tl1, tl2, *pc.usp++); /* range check */
pushaddr(popaddr() + (tl1 - tl2) * tl);
continue;
case O_INX4:
tl = *pc.usp++;
tl1 = pop4(); /* index */
tl2 = *pc.sp++;
- SUBSC(tl1, tl2, tl2 + *pc.usp++); /* range check */
+ SUBSC(tl1, tl2, *pc.usp++); /* range check */
pushaddr(popaddr() + (tl1 - tl2) * tl);
continue;
case O_OFF:
push8(pop4() / td);
continue;
case O_RV1:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push2(*(tcp + *pc.sp++));
continue;
case O_RV14:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push4(*(tcp + *pc.sp++));
continue;
case O_RV2:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push2(*(short *)(tcp + *pc.sp++));
continue;
case O_RV24:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push4(*(short *)(tcp + *pc.sp++));
continue;
case O_RV4:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push4(*(long *)(tcp + *pc.sp++));
continue;
case O_RV8:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push8(*(double *)(tcp + *pc.sp++));
continue;
case O_RV:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
tcp += *pc.sp++;
tl = *pc.usp++;
tcp1 = pushsp(tl);
blkcpy(tl, tcp, tcp1);
continue;
case O_LV:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
pushaddr(tcp + *pc.sp++);
continue;
case O_LRV1:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push2(*(tcp + *pc.lp++));
continue;
case O_LRV14:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push4(*(tcp + *pc.lp++));
continue;
case O_LRV2:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push2(*(short *)(tcp + *pc.lp++));
continue;
case O_LRV24:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push4(*(short *)(tcp + *pc.lp++));
continue;
case O_LRV4:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push4(*(long *)(tcp + *pc.lp++));
continue;
case O_LRV8:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
push8(*(double *)(tcp + *pc.lp++));
continue;
case O_LRV:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
tcp += *pc.lp++;
tl = *pc.usp++;
tcp1 = pushsp(tl);
blkcpy(tl, tcp, tcp1);
continue;
case O_LLV:
- tcp = _display[*pc.ucp++].locvars;
+ tcp = _display.raw[*pc.ucp++];
pushaddr(tcp + *pc.lp++);
continue;
case O_IND1:
continue;
case O_ASRT:
pc.cp++;
- ASRT(pop2());
+ ASRT(pop2(), "");
continue;
case O_FOR1U:
pc.cp++;
PFLUSH();
curfile = ERR;
continue;
+ case O_PUT:
+ pc.cp++;
+ PUT(curfile);
+ continue;
case O_GET:
pc.cp++;
GET(curfile);
push2(pop4() & 1);
continue;
case O_SUCC2:
- /* Pi should be fixed to gen code for:
- * tl = *pc.cp++;
- * if (tl == 0)
- * tl = *pc.sp++;
- * tl1 = pop4();
- * push2(SUCC(tl1, tl, *pc.sp++));
- */
- pc.cp++;
- push2(pop4() + 1);
+ tl = *pc.cp++;
+ if (tl == 0)
+ tl = *pc.sp++;
+ tl1 = pop4();
+ push2(SUCC(tl1, tl, *pc.sp++));
continue;
case O_SUCC24:
- /* Pi should be fixed to gen code for:
- * tl = *pc.cp++;
- * if (tl == 0)
- * tl = *pc.sp++;
- * tl1 = pop4();
- * push4(SUCC(tl1, tl, *pc.sp++));
- */
+ tl = *pc.cp++;
+ if (tl == 0)
+ tl = *pc.sp++;
+ tl1 = pop4();
+ push4(SUCC(tl1, tl, *pc.sp++));
+ continue;
case O_SUCC4:
- /* Pi should be fixed to gen code for:
- * tl = *pc.cp++;
- * if (tl == 0)
- * tl = *pc.lp++;
- * tl1 = pop4();
- * push4(SUCC(tl1, tl, *pc.lp++));
- */
- pc.cp++;
- push4(pop4() + 1);
+ tl = *pc.cp++;
+ if (tl == 0)
+ tl = *pc.lp++;
+ tl1 = pop4();
+ push4(SUCC(tl1, tl, *pc.lp++));
continue;
case O_PRED2:
- /* Pi should be fixed to gen code for:
- * tl = *pc.cp++;
- * if (tl == 0)
- * tl = *pc.sp++;
- * tl1 = pop4();
- * push2(PRED(tl1, tl, *pc.sp++));
- */
- pc.cp++;
- push2(pop4() - 1);
+ tl = *pc.cp++;
+ if (tl == 0)
+ tl = *pc.sp++;
+ tl1 = pop4();
+ push2(PRED(tl1, tl, *pc.sp++));
continue;
case O_PRED24:
- /* Pi should be fixed to gen code for:
- * tl = *pc.cp++;
- * if (tl == 0)
- * tl = *pc.sp++;
- * tl1 = pop4();
- * push4(PRED(tl1, tl, *pc.sp++));
- */
+ tl = *pc.cp++;
+ if (tl == 0)
+ tl = *pc.sp++;
+ tl1 = pop4();
+ push4(PRED(tl1, tl, *pc.sp++));
+ continue;
case O_PRED4:
- /* Pi should be fixed to gen code for:
- * tl = *pc.cp++;
- * if (tl == 0)
- * tl = *pc.lp++;
- * tl1 = pop4();
- * push4(PRED(tl1, tl, *pc.lp++));
- */
- pc.cp++;
- push4(pop4() - 1);
+ tl = *pc.cp++;
+ if (tl == 0)
+ tl = *pc.lp++;
+ tl1 = pop4();
+ push4(PRED(tl1, tl, *pc.lp++));
continue;
case O_SEED:
pc.cp++;
/* Copyright (c) 1979 Regents of the University of California */
-static char sccsid[] = "@(#)utilities.c 1.1 %G%";
+static char sccsid[] = "@(#)utilities.c 1.2 %G%";
#include "vars.h"
#include "panics.h"
long sys_time;
long child_usr_time;
long child_sys_time;
- } tbuf;
+ } tbuf;
register double l;
register long count;
+# ifdef PROFILE
+# define proffile "/vb/grad/mckusick/px/profile/pcnt.out"
+ struct cntrec {
+ double counts[NUMOPS]; /* instruction counts */
+ long runs; /* number of interpreter runs */
+ long startdate; /* date profile started */
+ long usrtime; /* total user time consumed */
+ long systime; /* total system time consumed */
+ double stmts; /* number of pascal stmts executed */
+ } profdata;
+ FILE *datafile;
+# endif PROFILE
if (_nodump)
return(0);
times(&tbuf);
-#ifdef profile
+# ifdef PROFILE
datafile = fopen(proffile,"r");
- if (datafile != NULL) {
- count = fread(&profdata,sizeof(profdata),1,datafile);
- if (count != 1) {
- for (count = 0; count < numops; count++)
- profdata.counts[count] = 0.0;
- profdata.runs = 0;
- profdata.startdate = time(0);
- profdata.usrtime = 0;
- profdata.systime = 0;
- profdata.stmts = 0;
- }
- for (count = 0; count < numops; count++)
- profdata.counts[count] += profcnts[count];
- profdata.runs += 1;
- profdata.stmts += stcnt;
- profdata.usrtime += tbuf.usr_time;
- profdata.systime += tbuf.sys_time;
- datafile = freopen(proffile,"w",datafile);
- if (datafile != NULL) {
- fwrite(&profdata,sizeof(profdata),1,datafile);
- fclose(datafile);
- }
- }
-#endif
+ if (datafile == NULL)
+ goto skipprof;
+ count = fread(&profdata,1,sizeof(profdata),datafile);
+ if (count != sizeof(profdata))
+ goto skipprof;
+ for (count = 0; count < NUMOPS; count++)
+ profdata.counts[count] += _profcnts[count];
+ profdata.runs += 1;
+ profdata.stmts += _stcnt;
+ profdata.usrtime += tbuf.usr_time;
+ profdata.systime += tbuf.sys_time;
+ datafile = freopen(proffile,"w",datafile);
+ if (datafile == NULL)
+ goto skipprof;
+ count = fwrite(&profdata,1,sizeof(profdata),datafile);
+ if (count != sizeof(profdata))
+ goto skipprof;
+ fclose(datafile);
+skipprof:
+# endif PROFILE
l = tbuf.usr_time;
l = l / HZ;
fprintf(stderr,
register struct stack *ap;
register char *cp;
register long i, linum;
- struct disp disp[MAXLVL];
+ struct disply disp;
if (_lino <= 0) {
fputs("Program was not executed.\n",stderr);
return;
}
- for (i=0; i<MAXLVL; i++)
- disp[i] = _display[i];
+ disp = _display;
if (errnum == PINTR)
fputs("\n\tInterrupted in \"",stderr);
else if (errnum == PHALT)
fprintf(stderr,"+%1d near line %1d.",i,linum);
fputc('\n',stderr);
*mydp = (ap)->odisp;
- if (mydp <= &_display[1]){
- for (i=0; i<MAXLVL; i++)
- _display[i] = disp[i];
+ if (mydp <= &_display.frame[1]){
+ _display = disp;
psexit(errnum);
}
mydp = (ap)->dp;
/* Copyright (c) 1979 Regents of the University of California */
-/* static char sccsid[] = "@(#)vars.h 1.1 %G%"; */
+/* static char sccsid[] = "@(#)vars.h 1.2 %G%"; */
#include <stdio.h>
#define PIX 1 /* load and go */
#define PIPE 2 /* bootstrap via a pipe */
#define releq 0
-#define relne 1
-#define rellt 2
-#define relgt 3
-#define relle 4
-#define relge 5
+#define relne 2
+#define rellt 4
+#define relgt 6
+#define relle 8
+#define relge 10
/*
* interrupt and allocation routines
* | |
* | block mark |
* | |
- * --------------- <-- display entry points here
- * | |
+ * --------------- <-- display entry "stp" points here
+ * | | <-- display entry "locvars" points here
* | local |
* | variables |
* | |
* - - - - - - - -
*
* The information in the block mark is thus at positive offsets from
- * the display pointer entries while the local variables are at negative
- * offsets. The block mark actually consists of two parts. The first
- * part is created at CALL and the second at entry, i.e. BEGIN. Thus:
+ * the display.stp pointer entries while the local variables are at negative
+ * offsets from display.locvars. The block mark actually consists of
+ * two parts. The first part is created at CALL and the second at entry,
+ * i.e. BEGIN. Thus:
*
* -------------------------
* | |
* | |
* | Saved (dp) |
* | |
- * | Current section name |
- * | and entry line ptr |
+ * | Pointer to current |
+ * | routine header info |
* | |
- * | Saved file name and |
- * | file buffer ptr |
+ * | Saved value of |
+ * | "curfile" |
* | |
* | Empty tos value |
* | |
long lino; /* previous line number */
};
+union disply {
+ struct disp frame[MAXLVL];
+ char *raw[2*MAXLVL];
+};
+
/*
* formal routine structure
*/
/*
* program variables
*/
-extern struct disp _display[MAXLVL]; /* runtime display */
-extern struct disp *_dp; /* runtime display */
-extern long _lino; /* current line number */
-extern int _argc; /* number of passed args */
-extern char **_argv; /* values of passed args */
-extern long _nodump; /* 1 => no post mortum dump */
-extern long _mode; /* execl by PX, PIPE, or PIX */
-extern long _stlim; /* statement limit */
-extern long _stcnt; /* statement count */
-extern char *_maxptr; /* maximum valid pointer */
-extern char *_minptr; /* minimum valid pointer */
-extern long *_pcpcount; /* pointer to pxp buffer */
-extern long _cntrs; /* number of counters */
-extern long _rtns; /* number of routine cntrs */
-
+extern union disply _display; /* runtime display */
+extern struct disp *_dp; /* ptr to active frame */
+extern long _lino; /* current line number */
+extern int _argc; /* number of passed args */
+extern char **_argv; /* values of passed args */
+extern long _nodump; /* 1 => no post mortum dump */
+extern long _mode; /* execl by PX, PIPE, or PIX */
+extern long _stlim; /* statement limit */
+extern long _stcnt; /* statement count */
+extern char *_maxptr; /* maximum valid pointer */
+extern char *_minptr; /* minimum valid pointer */
+extern long *_pcpcount; /* pointer to pxp buffer */
+extern long _cntrs; /* number of counters */
+extern long _rtns; /* number of routine cntrs */
+\f
/*
* The file i/o routines maintain a notion of a "current file".
* A pointer to this file structure is kept in "curfile".
char buf[BUFSIZ]; /* I/O buffer */
char window[1]; /* file window element */
};
-
+\f
/*
* unit flags
*/
extern struct iorechd input;
extern struct iorechd output;
extern struct iorechd _err;
-\f
-#ifdef profile
+
/*
- * Px execution profile data
+ * Px execution profile array
*/
-#define numops 256
-struct cntrec {
- double counts[numops]; /* instruction counts */
- long runs; /* number of interpreter runs */
- long startdate; /* date profile started */
- long usrtime; /* total user time consumed */
- long systime; /* total system time consumed */
- double stmts; /* number of pascal statements executed */
- } profdata;
-long profcnts[numops];
-#define proffile "/usr/grad/mckusick/px/profile/pcnt.out"
-FILE *datafile; /* input datafiles */
-#else
-int profcnts; /* dummy just to keep the linker happy */
-#endif
+#ifdef PROFILE
+#define NUMOPS 256
+extern long _profcnts[NUMOPS];
+#endif PROFILE