do {
npos=exactmatch=0;
for(rpp=reglist[propno];rp= *rpp; rpp++)
- if (getrefcount(rp-machregs, FALSE)==0) {
+ if (getrefcount((int)(rp-machregs), FALSE)==0) {
pos[npos++] = rp-machregs;
if (eqtoken(&rp->r_contents,&token))
exactmatch++;
for (i=0;i<TOKENSIZE;i++)
if (tdp->t_type[i] == EV_REG &&
clash(rp->r_contents.t_att[i].ar,tp2->t_att[0].ar)) {
- erasereg(rp-machregs);
+ erasereg((int)(rp-machregs));
break;
}
}
rp->r_contents.t_token = 0;
for (i=0;i<TOKENSIZE;i++)
rp->r_contents.t_att[i].aw = 0;
- awayreg(rp-machregs);
+ awayreg((int)(rp-machregs));
}
#endif
}
for (rp=machregs;rp<machregs+NREGS;rp++) {
if (rp->r_contents.t_token == -1) {
if (rp->r_contents.t_att[0].ar == regno)
- erasereg(rp-machregs);
+ erasereg((int)(rp-machregs));
} else if (rp->r_contents.t_token > 0) {
tdp= & tokens[rp->r_contents.t_token];
for (i=0;i<TOKENSIZE;i++)
if (tdp->t_type[i] == EV_REG &&
rp->r_contents.t_att[i].ar == regno) {
- erasereg(rp-machregs);
+ erasereg((int)(rp-machregs));
break;
}
}
if (cp->c1_prop>=0) {
for (rpp=reglist[cp->c1_prop];
(rp = *rpp)!=0 &&
- getrefcount(rp-machregs, TRUE)!=0;
+ getrefcount((int)(rp-machregs), TRUE)!=0;
rpp++)
;
if (rp==0)
static pseudo();
extern char em_flag[];
+char C_error;
#define flags(pp) (em_flag[(pp)->em_opcode - sp_fmnem] & EM_PAR)
arith C_holsize, C_bsssize;
int C_holinit, C_bssinit;
+int
C_out(p)
register struct e_instr *p;
{
DFDNAM(p->em_dnam);
NL();
break;
-
+ default:
+ C_error = "Illegal EM line";
+ return 0;
}
+ return 1;
}
static
return;
}
#endif
- if (C_opp != obuf && sys_write(C_ofp, obuf, C_opp - obuf) == 0) {
+ if (C_opp != obuf && sys_write(C_ofp, obuf, (int)(C_opp - obuf)) == 0) {
C_ofp = 0;
C_failed();
}
.B int C_getid()
.PP
.B char *C_tmpdir;
+.PP
+.B #include <em.h>
+.PP
+.B int C_out(p)
+.B struct e_instr *p;
+.PP
+.B char *C_error;
.fi
.SH DESCRIPTION
This package provides a procedural EM code interface to be used in
.I C_tmpdir
before calling
.IR C_open.
+.PP
+.I C_out
+accepts a structure as delivered by the
+.I read_em
+module, and produces code for it. It returns 1 if it succeeds, 0 if it fails
+for some reason. The reason can then be found in \fIC_error\fP. The
+.I C_out
+routine replaces the EM_mkcalls routine.
.SH FILES
.nf
~em/modules/h/em.h
while (m <= &mems[NMEMS-1]) {
fprintf(stderr, "mem %d: full %lx, free %lx\n",
- m - mems,
+ (int)(m - mems),
(long) m->mem_full,
(long) m->mem_left);
m++;