Add function prototypes.

This commit is contained in:
carl 2019-03-25 00:10:45 +08:00
parent 2dd0d0f81b
commit 2f84fc92cf
3 changed files with 14 additions and 9 deletions

View file

@ -42,3 +42,10 @@ int regbit[] = { /* push-pull coding */
#define B 9
#define CC 10
#define DP 11
/* Motorola 6809 specific routines */
void branch(register int opc, expr_t exp);
int regno(register int r);
void emit1or2(int n);
void offset(register int reg, expr_t exp, register int ind);

View file

@ -167,7 +167,7 @@ reglist : ALL
{ if (($$ = regbit[$1]) < 0) serror("register error");}
|
reglist ',' REG
{ register i;
{ register int i;
if ((i = regbit[$3]) < 0 || ($1 & i) != 0)
serror("register error");
$$ = $1 | i;

View file

@ -8,9 +8,7 @@
* Motorola 6809 special routines
*/
branch(opc, exp)
register int opc;
expr_t exp;
void branch(register int opc, expr_t exp)
{
register int sm, dist;
int saving;
@ -47,7 +45,8 @@ expr_t exp;
emit1(lowb(dist));
}
regno(r) register r; {
int regno(register int r)
{
switch (r) {
case X: return 0;
case Y: return 0x20;
@ -57,15 +56,14 @@ regno(r) register r; {
return -1;
}
emit1or2(n) {
void emit1or2(int n)
{
if (n & ~0xFF)
emit1(n >> 8);
emit1(n);
}
offset(reg, exp, ind)
register int reg, ind;
expr_t exp;
void offset(register int reg, expr_t exp, register int ind)
{
if (reg == PC) {
int sm, dist;