Add function prototypes.

This commit is contained in:
carl 2019-03-25 00:11:31 +08:00
parent ef3a6b3cc4
commit 98c5d1f0ee
2 changed files with 49 additions and 45 deletions

View file

@ -100,3 +100,28 @@ char dr_m[8][8] = {
-1, -1, -1, -1, -1, -1, -1, -1 -1, -1, -1, -1, -1, -1, -1, -1
}; };
#endif #endif
/* 80386 specific routines */
void ea_1_16(int param);
void ea_1(int param);
void ea_2(int param);
int checkscale(valu_t val);
void reverse(void);
void badsyntax(void);
void regsize(int sz);
void indexed(void);
void ebranch(register int opc,expr_t exp);
void branch(register int opc,expr_t exp);
void pushop(register int opc);
void opsize_exp(expr_t exp, int nobyte);
void adsize_exp(expr_t exp, int relpc);
void addop(register int opc);
void rolop(register int opc);
void incop(register int opc);
void callop(register int opc);
void xchg(register int opc);
void test(register int opc);
void mov(register int opc);
void extshft(int opc, int reg);
void bittestop(int opc);
void imul(int reg);

View file

@ -8,7 +8,7 @@
* INTEL 80386 special routines * INTEL 80386 special routines
*/ */
ea_1_16(param) void ea_1_16(int param)
{ {
reg_1 &= 0377; reg_1 &= 0377;
if ((reg_1 & 070) || (param & ~070)) { if ((reg_1 & 070) || (param & ~070)) {
@ -38,8 +38,7 @@ ea_1_16(param)
} }
} }
void void ea_1(int param) {
ea_1(param) {
if (! address_long) { if (! address_long) {
ea_1_16(param); ea_1_16(param);
return; return;
@ -71,16 +70,14 @@ ea_1(param) {
} }
} }
ea_2(param) { void ea_2(int param) {
op_1 = op_2; op_1 = op_2;
RELOMOVE(rel_1, rel_2); RELOMOVE(rel_1, rel_2);
ea_1(param); ea_1(param);
} }
int int checkscale(valu_t val)
checkscale(val)
valu_t val;
{ {
int v = val; int v = val;
@ -105,7 +102,7 @@ checkscale(val)
/*NOTREACHED*/ /*NOTREACHED*/
} }
reverse() { void reverse(void) {
struct operand op; struct operand op;
#ifdef RELOCATION #ifdef RELOCATION
int r = rel_1; int r = rel_1;
@ -115,13 +112,13 @@ reverse() {
op = op_1; op_1 = op_2; op_2 = op; op = op_1; op_1 = op_2; op_2 = op;
} }
badsyntax() { void badsyntax(void)
{
serror("bad operands"); serror("bad operands");
} }
regsize(sz) void regsize(int sz)
int sz;
{ {
register int bit; register int bit;
@ -135,8 +132,7 @@ regsize(sz)
} }
} }
void void indexed(void) {
indexed() {
if (address_long) { if (address_long) {
mod_2 = 0; mod_2 = 0;
if (sib_2 == -1) if (sib_2 == -1)
@ -175,9 +171,7 @@ indexed() {
} }
} }
ebranch(opc,exp) void ebranch(register int opc,expr_t exp)
register int opc;
expr_t exp;
{ {
/* Conditional branching; Full displacements are available /* Conditional branching; Full displacements are available
on the 80386, so the welknown trick with the reverse branch on the 80386, so the welknown trick with the reverse branch
@ -220,9 +214,7 @@ ebranch(opc,exp)
} }
} }
branch(opc,exp) void branch(register int opc,expr_t exp)
register int opc;
expr_t exp;
{ {
/* LOOP, JCXZ, etc. branch instructions. /* LOOP, JCXZ, etc. branch instructions.
Here, the offset just must fit in a byte. Here, the offset just must fit in a byte.
@ -237,8 +229,7 @@ branch(opc,exp)
emit1((int)dist); emit1((int)dist);
} }
pushop(opc) void pushop(register int opc)
register int opc;
{ {
regsize(1); regsize(1);
@ -274,8 +265,7 @@ pushop(opc)
} }
} }
opsize_exp(exp, nobyte) void opsize_exp(expr_t exp, int nobyte)
expr_t exp;
{ {
if (! nobyte) { if (! nobyte) {
#ifdef RELOCATION #ifdef RELOCATION
@ -297,8 +287,7 @@ opsize_exp(exp, nobyte)
} }
} }
adsize_exp(exp, relpc) void adsize_exp(expr_t exp, int relpc)
expr_t exp;
{ {
if (address_long) { if (address_long) {
#ifdef RELOCATION #ifdef RELOCATION
@ -314,8 +303,7 @@ adsize_exp(exp, relpc)
} }
} }
addop(opc) void addop(register int opc)
register int opc;
{ {
regsize(opc); regsize(opc);
@ -348,8 +336,7 @@ addop(opc)
badsyntax(); badsyntax();
} }
rolop(opc) void rolop(register int opc)
register int opc;
{ {
register int oreg; register int oreg;
@ -378,8 +365,7 @@ rolop(opc)
badsyntax(); badsyntax();
} }
incop(opc) void incop(register int opc)
register int opc;
{ {
regsize(opc); regsize(opc);
@ -392,8 +378,7 @@ incop(opc)
} }
} }
callop(opc) void callop(register int opc)
register int opc;
{ {
regsize(1); regsize(1);
@ -412,8 +397,7 @@ callop(opc)
} }
} }
xchg(opc) void xchg(register int opc)
register int opc;
{ {
regsize(opc); regsize(opc);
@ -428,8 +412,7 @@ xchg(opc)
badsyntax(); badsyntax();
} }
test(opc) void test(register int opc)
register int opc;
{ {
regsize(opc); regsize(opc);
@ -453,8 +436,7 @@ test(opc)
badsyntax(); badsyntax();
} }
mov(opc) void mov(register int opc)
register int opc;
{ {
regsize(opc); regsize(opc);
@ -495,8 +477,7 @@ mov(opc)
badsyntax(); badsyntax();
} }
extshft(opc, reg) void extshft(int opc, int reg)
int opc;
{ {
int oreg2 = reg_2; int oreg2 = reg_2;
@ -521,8 +502,7 @@ extshft(opc, reg)
else badsyntax(); else badsyntax();
} }
bittestop(opc) void bittestop(int opc)
int opc;
{ {
regsize(1); regsize(1);
emit1(0xF); emit1(0xF);
@ -542,8 +522,7 @@ bittestop(opc)
else badsyntax(); else badsyntax();
} }
imul(reg) void imul(int reg)
int reg;
{ {
/* This instruction is more elaborate on the 80386. Its most /* This instruction is more elaborate on the 80386. Its most
general form is: general form is: