Added prototyping stuff

This commit is contained in:
ceriel 1993-11-10 10:26:07 +00:00
parent 31752a4617
commit abf052244b
53 changed files with 226 additions and 55 deletions

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhcst(op, n, w, i)
arith n;
arith w;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhdlb(op, n, s, off, i)
arith n;
label s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhdnam(op, n, s, off, i)
arith n;
char *s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhfcon(op, n, s, sz, i)
arith n;
char *s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhicon(op, n, s, sz, i)
arith n;
char *s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhilb(op, n, l, i)
arith n;
label l;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhpnam(op, n, p, i)
arith n;
char *p;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_bhucon(op, n, s, sz, i)
arith n;
char *s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crcst(op, v)
arith v;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crdlb(op, v, off)
label v;
arith off;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crdnam(op, s, off)
char *s;
arith off;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crilb(op, l)
label l;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crpnam(op, p)
char *p;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crscon(op, v, s)
char *v;
arith s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_crxcon(op, spec, v, s)
char *v;
arith s;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_cst(l)
arith l;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_dfdlb(l)
label l;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_dfdnam(s)
char *s;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_dfilb(l)
label l;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_dlb(l, val)
label l;
arith val;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_dnam(str, val)
char *str;
arith val;

View file

@ -46,6 +46,7 @@ char *C_current_out = obuf;
char *C_opp = obuf;
#endif
void
C_flush() {
#ifdef INCORE
static unsigned int bufsiz;
@ -78,6 +79,7 @@ C_flush() {
#define Xputbyte(c) put(c)
#endif
void
C_putbyte(c)
int c;
{
@ -89,11 +91,13 @@ C_putbyte(c)
#endif
/*ARGSUSED*/
void
C_init(w, p)
arith w, p;
{
}
int
C_open(nm)
char *nm;
{
@ -108,6 +112,7 @@ C_open(nm)
return 1;
}
void
C_close()
{
/* Finish the code-generation.
@ -142,6 +147,7 @@ C_close()
C_ofp = 0;
}
int
C_busy()
{
return C_ofp != 0; /* true if code is being generated */
@ -156,6 +162,7 @@ C_busy()
names.
*/
void
C_magic()
{
}
@ -171,12 +178,14 @@ wrs(s)
}
}
void
C_pt_dnam(s)
char *s;
{
wrs(s);
}
void
C_pt_ilb(l)
label l;
{
@ -189,6 +198,7 @@ C_pt_ilb(l)
extern char em_mnem[][4];
extern char em_pseu[][4];
void
C_pt_op(x)
{
C_putbyte(' ');
@ -196,6 +206,7 @@ C_pt_op(x)
C_putbyte(' ');
}
void
C_pt_cst(l)
arith l;
{
@ -205,6 +216,7 @@ C_pt_cst(l)
wrs(buf);
}
void
C_pt_scon(x, y)
char *x;
arith y;
@ -224,6 +236,7 @@ C_pt_scon(x, y)
C_putbyte('\'');
}
void
C_pt_ps(x)
{
C_putbyte(' ');
@ -231,6 +244,7 @@ C_pt_ps(x)
C_putbyte(' ');
}
void
C_pt_dlb(l)
label l;
{
@ -240,6 +254,7 @@ C_pt_dlb(l)
wrs(buf);
}
void
C_pt_doff(l, v)
label l;
arith v;
@ -253,6 +268,7 @@ C_pt_doff(l, v)
}
}
void
C_pt_noff(s, v)
char *s;
arith v;
@ -266,6 +282,7 @@ C_pt_noff(s, v)
}
}
void
C_pt_pnam(s)
char *s;
{
@ -273,6 +290,7 @@ C_pt_pnam(s)
wrs(s);
}
void
C_pt_dfilb(l)
label l;
{
@ -282,6 +300,7 @@ C_pt_dfilb(l)
wrs(buf);
}
void
C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
int sp;
char *v;
@ -294,9 +313,20 @@ C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
C_pt_cst(sz);
}
C_pt_nl() { C_putbyte('\n'); }
C_pt_comma() { C_putbyte(','); }
C_pt_ccend() { C_putbyte('?'); }
void
C_pt_nl() {
C_putbyte('\n');
}
void
C_pt_comma() {
C_putbyte(',');
}
void
C_pt_ccend() {
C_putbyte('?');
}
#else /* READABLE_EM */
@ -312,6 +342,7 @@ C_pt_ccend() { C_putbyte('?'); }
names.
*/
void
C_magic()
{
put16(sp_magic);
@ -321,6 +352,7 @@ C_magic()
#define fit16i(x) ((x) >= (long)0xFFFF8000 && (x) <= (long)0x00007FFF)
#define fit8u(x) ((x) <= 0xFF) /* x is already unsigned */
void
C_pt_ilb(l)
register label l;
{
@ -334,6 +366,7 @@ C_pt_ilb(l)
}
}
void
C_pt_dlb(l)
register label l;
{
@ -347,6 +380,7 @@ C_pt_dlb(l)
}
}
void
C_pt_cst(l)
register arith l;
{
@ -367,6 +401,7 @@ C_pt_cst(l)
}
}
void
C_pt_doff(l, v)
label l;
arith v;
@ -381,6 +416,27 @@ C_pt_doff(l, v)
}
}
void
C_pt_str(s)
register char *s;
{
register int len;
C_pt_cst((arith) (len = strlen(s)));
while (--len >= 0) {
put8(*s++);
}
}
void
C_pt_dnam(s)
char *s;
{
put8(sp_dnam);
C_pt_str(s);
}
void
C_pt_noff(s, v)
char *s;
arith v;
@ -395,13 +451,7 @@ C_pt_noff(s, v)
}
}
C_pt_dnam(s)
char *s;
{
put8(sp_dnam);
C_pt_str(s);
}
void
C_pt_pnam(s)
char *s;
{
@ -409,6 +459,7 @@ C_pt_pnam(s)
C_pt_str(s);
}
void
C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
int sp;
char *v;
@ -420,17 +471,7 @@ C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
C_pt_str(v);
}
C_pt_str(s)
register char *s;
{
register int len;
C_pt_cst((arith) (len = strlen(s)));
while (--len >= 0) {
put8(*s++);
}
}
void
C_pt_scon(b, n)
register char *b;
register arith n;

View file

@ -87,3 +87,61 @@
#ifndef sp_icon
#include <em_spec.h>
#endif
/* prototypes, also hand written. */
_PROTOTYPE(void CC_bhcst, (int, arith, arith, int));
_PROTOTYPE(void CC_bhdlb, (int, arith, label, arith, int));
_PROTOTYPE(void CC_bhdnam, (int, arith, char *, arith, int));
_PROTOTYPE(void CC_bhfcon, (int, arith, char *, arith, int));
_PROTOTYPE(void CC_bhicon, (int, arith, char *, arith, int));
_PROTOTYPE(void CC_bhilb, (int, arith, label, int));
_PROTOTYPE(void CC_bhpnam, (int, arith, char *, int));
_PROTOTYPE(void CC_bhucon, (int, arith, char *, arith, int));
_PROTOTYPE(void CC_crcst, (int, arith));
_PROTOTYPE(void CC_crdlb, (int, label, arith));
_PROTOTYPE(void CC_crdnam, (int, char *, arith));
_PROTOTYPE(void CC_crilb, (int, label));
_PROTOTYPE(void CC_crpnam, (int, char *));
_PROTOTYPE(void CC_crscon, (int, char *, arith));
_PROTOTYPE(void CC_crxcon, (int, int, char *, arith));
_PROTOTYPE(void CC_cst, (arith));
_PROTOTYPE(void CC_dfdlb, (label));
_PROTOTYPE(void CC_dfdnam, (char *));
_PROTOTYPE(void CC_dfilb, (label));
_PROTOTYPE(void CC_dlb, (label, arith));
_PROTOTYPE(void CC_dnam, (char *, arith));
_PROTOTYPE(void CC_end, (arith));
_PROTOTYPE(void CC_endnarg, (void));
_PROTOTYPE(void CC_exc, (arith, arith));
_PROTOTYPE(void CC_fcon, (char *, arith));
_PROTOTYPE(void CC_icon, (char *, arith));
_PROTOTYPE(void CC_ilb, (label));
_PROTOTYPE(void CC_msend, (void));
_PROTOTYPE(void CC_msstart, (int));
_PROTOTYPE(void CC_op, (int));
_PROTOTYPE(void CC_opcst, (int, arith));
_PROTOTYPE(void CC_opdlb, (int, label, arith));
_PROTOTYPE(void CC_opdnam, (int, char *, arith));
_PROTOTYPE(void CC_opilb, (int, label));
_PROTOTYPE(void CC_opnarg, (int));
_PROTOTYPE(void CC_oppnam, (int, char *));
_PROTOTYPE(void CC_pnam, (char *));
_PROTOTYPE(void CC_pro, (char *, arith));
_PROTOTYPE(void CC_pronarg, (char *));
_PROTOTYPE(void CC_psdlb, (int, label));
_PROTOTYPE(void CC_psdnam, (int, char *));
_PROTOTYPE(void CC_pspnam, (int, char *));
_PROTOTYPE(void CC_scon, (char *, arith));
_PROTOTYPE(void CC_ucon, (char *, arith));
_PROTOTYPE(void C_init, (arith, arith));
_PROTOTYPE(void C_failed, (void));
_PROTOTYPE(void C_internal_error, (void));
_PROTOTYPE(int C_open, (char *));
_PROTOTYPE(void C_close, (void));
_PROTOTYPE(int C_busy, (void));
_PROTOTYPE(void C_magic, (void));
_PROTOTYPE(int C_getid, (void));
_PROTOTYPE(void C_insertpart, (int));
_PROTOTYPE(void C_beginpart, (int));
_PROTOTYPE(void C_endpart, (int));

View file

@ -6,61 +6,61 @@ emcode \- EM code interface for compilers
.nf
.B #include <em.h>
.PP
.B C_init(wsize, psize)
.B void C_init(wsize, psize)
.B arith wsize, psize;
.PP
.B int C_open(filename)
.B C_close()
.B void C_close()
.B int C_busy()
.B char *filename;
.PP
.B C_magic()
.B void C_magic()
.PP
.B C_df_dlb(l)
.B C_df_dnam(s)
.B C_df_ilb(l)
.B void C_df_dlb(l)
.B void C_df_dnam(s)
.B void C_df_ilb(l)
.B label l; char *s;
.PP
.B C_pro(s, l)
.B C_pro_narg(s)
.B C_end(l)
.B C_end_narg()
.B void C_pro(s, l)
.B void C_pro_narg(s)
.B void C_end(l)
.B void C_end_narg()
.B char *s; arith l;
.PP
.B C_exa_dlb(l)
.B C_exa_dnam(s)
.B C_exp(s)
.B C_ina_dlb(l)
.B C_ina_dnam(s)
.B C_inp(s)
.B void C_exa_dlb(l)
.B void C_exa_dnam(s)
.B void C_exp(s)
.B void C_ina_dlb(l)
.B void C_ina_dnam(s)
.B void C_inp(s)
.B char *s; label l;
.PP
.BI C_bss_ cstp ()
.BI C_hol_ cstp ()
.BI C_con_ cstp ()
.BI C_rom_ cstp ()
.BI "void C_bss_" cstp ()
.BI "void C_hol_" cstp ()
.BI "void C_con_" cstp ()
.BI "void C_rom_" cstp ()
.PP
.B #include <em_mes.h>
.B C_mes_begin(ms)
.BI C_ cstp ()
.B C_mes_end()
.B void C_mes_begin(ms)
.BI "void C_" cstp ()
.B void C_mes_end()
.B int ms;
.PP
.B C_exc(c1, c2)
.B void C_exc(c1, c2)
.B arith c1, c2;
.PP
.BI C_ mnem ()
.BI C_ mnem _dlb()
.BI C_ mnem _dnam()
.BI C_ mnem _narg()
.BI "void C_" mnem ()
.BI "void C_" mnem _dlb()
.BI "void C_" mnem _dnam()
.BI "void C_" mnem _narg()
.PP
.B C_insertpart(id)
.B void C_insertpart(id)
.B int id;
.PP
.B C_beginpart(id)
.B void C_beginpart(id)
.B int id;
.PP
.B C_endpart(id)
.B void C_endpart(id)
.B int id;
.PP
.B int C_getid()

View file

@ -14,6 +14,10 @@
#include <em_mnem.h>
#include <em_reg.h>
#include <ansi.h>
#include "em_codeEK.h"
#ifdef READABLE_EM
/* macros used in the definitions of the interface functions C_* */
#define OP(x) C_pt_op(x)
@ -64,3 +68,21 @@
#define C_pt_op(x) C_putbyte(x)
#define C_pt_ps(x) C_putbyte(x)
#endif /* READABLE_EM */
_PROTOTYPE(void C_pt_dnam, (char *));
_PROTOTYPE(void C_pt_ilb, (label));
_PROTOTYPE(void C_pt_op, (int));
_PROTOTYPE(void C_pt_cst, (arith));
_PROTOTYPE(void C_pt_scon, (char *, arith));
_PROTOTYPE(void C_pt_ps, (int));
_PROTOTYPE(void C_pt_dlb, (label));
_PROTOTYPE(void C_pt_doff, (label, arith));
_PROTOTYPE(void C_pt_noff, (char *, arith));
_PROTOTYPE(void C_pt_pnam, (char *));
_PROTOTYPE(void C_pt_dfilb, (label));
_PROTOTYPE(void C_pt_wcon, (int, char *, arith));
#ifdef READABLE_EM
_PROTOTYPE(void C_pt_nl, (void));
_PROTOTYPE(void C_pt_comma, (void));
_PROTOTYPE(void C_pt_ccend, (void));
#endif /* READABLE_EM */

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_end(l)
arith l;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_endnarg()
{
/* END pseudo of procedure with unknown # of locals

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_exc(c1,c2)
arith c1,c2;
{

View file

@ -5,6 +5,7 @@
*/
#include <system.h>
void
C_failed()
{
sys_write(STDERR,"read, write, or open failed\n",28);

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_fcon(val, siz)
char *val;
arith siz;

View file

@ -3,6 +3,7 @@
/* Get a unique id for C_insertpart, etc.
*/
int
C_getid()
{
static int id = 0;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_icon(val, siz)
char *val;
arith siz;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_ilb(l)
label l;
{

View file

@ -302,6 +302,7 @@ resume(p)
pp->pp_begin = C_current_out - C_BASE;
}
void
C_insertpart(part)
int part;
{
@ -340,6 +341,7 @@ C_insertpart(part)
resume(p);
}
void
C_beginpart(part)
int part;
{
@ -359,6 +361,7 @@ C_beginpart(part)
resume(p);
}
void
C_endpart(part)
int part;
{

View file

@ -5,6 +5,7 @@
*/
#include <system.h>
void
C_internal_error()
{
sys_write(STDERR,"internal error\n",15);

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_msend()
{
CEND();

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_msstart(cst)
int cst;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_op(opcode)
{
/* Instruction that never has an argument

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_opcst(opcode, cst)
arith cst;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_opdlb(opcode, dlb, offset)
label dlb;
arith offset;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_opdnam(opcode, dnam, offset)
char *dnam;
arith offset;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_opilb(opcode, ilb)
label ilb;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_opnarg(opcode)
{
/* Instruction with optional argument, but now without one

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_oppnam(opcode, pnam)
char *pnam;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_pnam(str)
char *str;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_pro(pnam, l)
char *pnam;
arith l;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_pronarg(pnam)
char *pnam;
{

View file

@ -6,7 +6,7 @@ ETC = $(SRC_HOME)/etc
SRC_DIR = $(SRC_HOME)/modules/src/em_code
MOD_DIR = $(TARGET_HOME)/modules
INCLUDES = -I$(TARGET_HOME)/h -I$(TARGET_HOME)/config -I$(MOD_DIR)/h -I$(SRC_HOME)/modules/src/read_em -I$(SRC_DIR)
INCLUDES = -I. -I$(TARGET_HOME)/h -I$(TARGET_HOME)/config -I$(MOD_DIR)/h -I$(SRC_HOME)/modules/src/read_em -I$(SRC_DIR)
CFLAGS = $(INCLUDES) $(COPTIONS)
SRC = $(SRC_DIR)/bhcst.c\
$(SRC_DIR)/bhdlb.c\
@ -64,11 +64,12 @@ OBS = failed.$(SUF) insert.$(SUF) internerr.$(SUF) getid.$(SUF)
all: em_codeEK.h libeme.$(LIBSUF) libemk.$(LIBSUF) em_code.3
install: all
-mkdir $(MOD_DIR)/lib
-mkdir $(MOD_DIR)/h
cp libeme.$(LIBSUF) $(MOD_DIR)/lib/libeme.$(LIBSUF)
$(RANLIB) $(MOD_DIR)/lib/libeme.$(LIBSUF)
cp libemk.$(LIBSUF) $(MOD_DIR)/lib/libemk.$(LIBSUF)
$(RANLIB) $(MOD_DIR)/lib/libemk.$(LIBSUF)
cp em_code.3 $(MOD_DIR)/man/em_code.3
cp em_codeEK.h $(MOD_DIR)/h/em_codeEK.h
if [ $(DO_MACHINE_INDEP) = y ] ; \
then mk_manpage em_code.3 $(TARGET_HOME) ; \
@ -78,7 +79,6 @@ cmp: all
-cmp libeme.$(LIBSUF) $(MOD_DIR)/lib/libeme.$(LIBSUF)
-cmp libemk.$(LIBSUF) $(MOD_DIR)/lib/libemk.$(LIBSUF)
-cmp em_codeEK.h $(MOD_DIR)/h/em_codeEK.h
-cmp em_code.3 $(MOD_DIR)/man/em_code.3
em_code.3: $(SRC_DIR)/em_code.3X
-sh -c 'tbl < $(SRC_DIR)/em_code.3X > em_code.3'

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_psdlb(op, dlb)
label dlb;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_psdnam(op, dnam)
char *dnam;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_pspnam(op, pnam)
char *pnam;
{

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_scon(str, siz)
char *str;
arith siz;

View file

@ -2,6 +2,7 @@
/* $Header$ */
void
CC_ucon(val,siz)
char *val;
arith siz;