Add function prototypes.

This commit is contained in:
carl 2019-03-25 00:13:56 +08:00
parent a6120c220e
commit f161a5867d
2 changed files with 18 additions and 19 deletions

View file

@ -22,3 +22,9 @@
extern expr_t par_exp; extern expr_t par_exp;
extern unsigned p_indirect; extern unsigned p_indirect;
extern int p_indexed; extern int p_indexed;
void page(void);
void pag2(void);
void rela(expr_t exp,int ind);
void absoa(expr_t exp, int ix, unsigned int ind);
void absob(expr_t exp, unsigned int ind);

View file

@ -12,22 +12,20 @@
#define MASK1 0x1FFF #define MASK1 0x1FFF
#define MASK2 0x1FFE #define MASK2 0x1FFE
page() void page(void)
{ {
if(((DOTVAL - 1) & MASK1) == MASK1) if(((DOTVAL - 1) & MASK1) == MASK1)
serror("page violation"); serror("page violation");
} }
pag2() void pag2(void)
{ {
if(((DOTVAL - 1) & MASK1) >= MASK2) if(((DOTVAL - 1) & MASK1) >= MASK2)
serror("page violation"); serror("page violation");
} }
rela(exp,ind) void rela(expr_t exp,int ind)
expr_t exp; {
int ind;
{
int c, d; int c, d;
page(); page();
if(pass == PASS_3){ if(pass == PASS_3){
@ -58,11 +56,8 @@ int ind;
emit1(low7(c) | ind); emit1(low7(c) | ind);
} }
absoa(exp, ix, ind) void absoa(expr_t exp, int ix, unsigned int ind)
expr_t exp; {
int ix;
unsigned ind;
{
pag2(); pag2();
#ifdef ASLD #ifdef ASLD
if(pass == PASS_3 && (exp.val & MASK) != (DOTVAL & MASK)) if(pass == PASS_3 && (exp.val & MASK) != (DOTVAL & MASK))
@ -74,10 +69,8 @@ unsigned ind;
emit2(low13(exp.val) | ind | ix); emit2(low13(exp.val) | ind | ix);
} }
absob(exp, ind) void absob(expr_t exp, unsigned int ind)
expr_t exp; {
unsigned ind;
{
pag2(); pag2();
#ifdef ASLD #ifdef ASLD
if (exp.val < 0) if (exp.val < 0)