From dcc2be5e8cfc7b6985b2f413329b5410de123a17 Mon Sep 17 00:00:00 2001 From: carl Date: Mon, 25 Mar 2019 00:12:21 +0800 Subject: [PATCH] Add function prototypes. --- mach/pdp/as/mach1.c | 9 ++++++++- mach/pdp/as/mach5.c | 32 ++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/mach/pdp/as/mach1.c b/mach/pdp/as/mach1.c index 5b92041df..ac5646edf 100644 --- a/mach/pdp/as/mach1.c +++ b/mach/pdp/as/mach1.c @@ -36,4 +36,11 @@ extern expr_t exp_1, exp_2; extern int rel_1, rel_2; extern int im1flag INIT(0); extern int im2flag INIT(0); -extern valu_t adjust(); + +void op1(int mode); +void op2(int mode); +void branch(int opc,expr_t exp); +void ejump(int opc, expr_t exp); +void sob(int reg, expr_t exp); +int jump(int opc,int opr); +valu_t adjust(expr_t exp); diff --git a/mach/pdp/as/mach5.c b/mach/pdp/as/mach5.c index b8a3bc1f9..ec15b077b 100644 --- a/mach/pdp/as/mach5.c +++ b/mach/pdp/as/mach5.c @@ -6,7 +6,8 @@ * */ -op1(mode) { +void op1(int mode) +{ int relpc = 0; if (im1flag) { if (mode == 067 || mode == 077) { @@ -23,7 +24,8 @@ op1(mode) { } } -op2(mode) { +void op2(int mode) +{ int relpc = 0; if (im2flag) { if (mode == 067 || mode == 077) { @@ -40,9 +42,10 @@ op2(mode) { } } -branch(opc,exp) expr_t exp; { - register eval; - register sm; +void branch(int opc,expr_t exp) +{ + register int eval; + register int sm; eval = adjust(exp) >> 1; sm = fitb(eval); @@ -53,8 +56,9 @@ branch(opc,exp) expr_t exp; { emit2(opc | lowb(eval)); } -ejump(opc, exp) expr_t exp; { - register sm,eval; +void ejump(int opc, expr_t exp) +{ + register int sm,eval; int gain; # ifdef THREE_PASS @@ -82,7 +86,8 @@ ejump(opc, exp) expr_t exp; { # endif } -sob(reg, exp) expr_t exp; { +void sob(int reg, expr_t exp) +{ if ((exp.typ & ~S_DOT) != DOTTYP) { serror("error in sob-label"); } @@ -91,12 +96,13 @@ sob(reg, exp) expr_t exp; { emit2( OPSOB | (reg << 6) | exp.val); } -jump(opc,opr) { - register val; +int jump(int opc,int opr) +{ + register int val; # ifdef THREE_PASS if (opr==067) { - register sm = 0; + register int sm = 0; val = adjust(exp_1) >> 1; if ( fitb(val) && (exp_1.typ & ~S_DOT) == DOTTYP) { @@ -111,9 +117,11 @@ jump(opc,opr) { # endif emit2(opc | opr); op1(opr); + return(0); } -valu_t adjust(exp) expr_t exp; { +valu_t adjust(expr_t exp) +{ valu_t val; val = exp.val - DOTVAL - 2;