}
else
{
- AddFixup(FU_QUICK, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_QUICK, sloc, a0expr);
D_word(inst);
}
}
else
{
- AddFixup(FU_WORD | FU_PCREL | FU_ISBRA, sloc, (TOKENPTR)a1expr);
+ AddFixup(FU_WORD | FU_PCREL | FU_ISBRA, sloc, a1expr);
D_word(0);
}
// Arrange for future fixup
if (!(a0exattr & DEFINED))
{
- AddFixup(FU_BYTE | FU_SEXT, sloc + 1, (TOKENPTR)a0expr);
+ AddFixup(FU_BYTE | FU_SEXT, sloc + 1, a0expr);
a0exval = 0;
}
else if ((uint32_t)a0exval + 0x100 >= 0x200)
if (siz == SIZB || siz == SIZS)
{
// .B
- AddFixup(FU_BBRA | FU_PCREL | FU_SEXT, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_BBRA | FU_PCREL | FU_SEXT, sloc, a0expr);
D_word(inst);
return OK;
}
{
// .W
D_word(inst);
- AddFixup(FU_WORD | FU_PCREL | FU_LBRA | FU_ISBRA, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_WORD | FU_PCREL | FU_LBRA | FU_ISBRA, sloc, a0expr);
D_word(0);
}
}
else
{
- AddFixup(FU_QUICK, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_QUICK, sloc, a0expr);
D_word(inst);
}
if (siz == SIZL)
inst |= 0x0040;
- if (*tok.u32 == '#')
+ if (*tok == '#')
{
// Handle #<expr>, ea
- tok.u32++;
+ tok++;
if (abs_expr(&eval) != OK)
return OK;
goto immed1;
}
- if ((*tok.u32 >= KW_D0) && (*tok.u32 <= KW_A7))
+ if ((*tok >= KW_D0) && (*tok <= KW_A7))
{
// <rlist>, ea
if (reglist(&rmask) < 0)
return OK;
immed1:
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
if (amode(0) < 0)
inst |= 0x0400 | am0 | a0reg;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
- if (*tok.u32 == EOL)
+ if (*tok == EOL)
return error("missing register list");
- if (*tok.u32 == '#')
+ if (*tok == '#')
{
// ea, #<expr>
- tok.u32++;
+ tok++;
if (abs_expr(&eval) != OK)
return OK;
else
{
// .L
- AddFixup(FU_LONG | FU_PCREL | FU_SEXT, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_LONG | FU_PCREL | FU_SEXT, sloc, a0expr);
D_word(inst);
return OK;
}
}
// Dc
- if ((*tok.u32 < KW_D0) && (*tok.u32 > KW_D7))
+ if ((*tok < KW_D0) && (*tok > KW_D7))
return error("CAS accepts only data registers");
- inst2 = (*tok.u32++) & 7;
+ inst2 = (*tok++) & 7;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
// Du
- if ((*tok.u32 < KW_D0) && (*tok.u32 > KW_D7))
+ if ((*tok < KW_D0) && (*tok > KW_D7))
return error("CAS accepts only data registers");
- inst2 |= ((*tok.u32++) & 7) << 6;
+ inst2 |= ((*tok++) & 7) << 6;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
// ea
if (modes > 1)
return error("too many ea fields");
- if (*tok.u32 != EOL)
+ if (*tok != EOL)
return error("extra (unexpected) text found");
// Reject invalud ea modes
}
// Dc1
- if ((*tok.u32 < KW_D0) && (*tok.u32 > KW_D7))
+ if ((*tok < KW_D0) && (*tok > KW_D7))
return error("CAS2 accepts only data registers for Dx1:Dx2 pairs");
- inst2 = (*tok.u32++) & 7;
+ inst2 = (*tok++) & 7;
- if (*tok.u32++ != ':')
+ if (*tok++ != ':')
return error("missing colon");
// Dc2
- if ((*tok.u32 < KW_D0) && (*tok.u32 > KW_D7))
+ if ((*tok < KW_D0) && (*tok > KW_D7))
return error("CAS2 accepts only data registers for Dx1:Dx2 pairs");
- inst3 = (*tok.u32++) & 7;
+ inst3 = (*tok++) & 7;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
// Du1
- if ((*tok.u32 < KW_D0) && (*tok.u32 > KW_D7))
+ if ((*tok < KW_D0) && (*tok > KW_D7))
return error("CAS2 accepts only data registers for Dx1:Dx2 pairs");
- inst2 |= ((*tok.u32++) & 7) << 6;
+ inst2 |= ((*tok++) & 7) << 6;
- if (*tok.u32++ != ':')
+ if (*tok++ != ':')
return error("missing colon");
// Du2
- if ((*tok.u32 < KW_D0) && (*tok.u32 > KW_D7))
+ if ((*tok < KW_D0) && (*tok > KW_D7))
return error("CAS2 accepts only data registers for Dx1:Dx2 pairs");
- inst3 |= ((*tok.u32++) & 7) << 6;
+ inst3 |= ((*tok++) & 7) << 6;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
// Rn1
- if (*tok.u32++ != '(')
+ if (*tok++ != '(')
return error("missing (");
- if ((*tok.u32 >= KW_D0) && (*tok.u32 <= KW_D7))
- inst2 |= (((*tok.u32++) & 7) << 12) | (0 << 15);
- else if ((*tok.u32 >= KW_A0) && (*tok.u32 <= KW_A7))
- inst2 |= (((*tok.u32++) & 7) << 12) | (1 << 15);
+ if ((*tok >= KW_D0) && (*tok <= KW_D7))
+ inst2 |= (((*tok++) & 7) << 12) | (0 << 15);
+ else if ((*tok >= KW_A0) && (*tok <= KW_A7))
+ inst2 |= (((*tok++) & 7) << 12) | (1 << 15);
else
return error("CAS accepts either data or address registers for Rn1:Rn2 pair");
- if (*tok.u32++ != ')')
+ if (*tok++ != ')')
return error("missing (");
- if (*tok.u32++ != ':')
+ if (*tok++ != ':')
return error("missing colon");
// Rn2
- if (*tok.u32++ != '(')
+ if (*tok++ != '(')
return error("missing (");
- if ((*tok.u32 >= KW_D0) && (*tok.u32 <= KW_D7))
- inst3 |= (((*tok.u32++) & 7) << 12) | (0 << 15);
- else if ((*tok.u32 >= KW_A0) && (*tok.u32 <= KW_A7))
- inst3 |= (((*tok.u32++) & 7) << 12) | (1 << 15);
+ if ((*tok >= KW_D0) && (*tok <= KW_D7))
+ inst3 |= (((*tok++) & 7) << 12) | (0 << 15);
+ else if ((*tok >= KW_A0) && (*tok <= KW_A7))
+ inst3 |= (((*tok++) & 7) << 12) | (1 << 15);
else
return error("CAS accepts either data or address registers for Rn1:Rn2 pair");
- if (*tok.u32++ != ')')
+ if (*tok++ != ')')
return error("missing (");
- if (*tok.u32 != EOL)
+ if (*tok != EOL)
return error("extra (unexpected) text found");
D_word(inst);
{
// .L
D_word(inst);
- AddFixup(FU_LONG | FU_PCREL | FU_SEXT, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_LONG | FU_PCREL | FU_SEXT, sloc, a0expr);
D_long(0);
return OK;
}
{
// .W
D_word(inst);
- AddFixup(FU_WORD | FU_PCREL | FU_SEXT, sloc, (TOKENPTR)a0expr);
+ AddFixup(FU_WORD | FU_PCREL | FU_SEXT, sloc, a0expr);
D_word(0);
}
}
else
{
- AddFixup(FU_WORD | FU_PCREL | FU_ISBRA, sloc, (TOKENPTR)a1expr);
+ AddFixup(FU_WORD | FU_PCREL | FU_ISBRA, sloc, a1expr);
D_word(0);
}
if (siz != SIZN)
return error("bad size suffix");
- if (*tok.u32 >= KW_D0 && *tok.u32 <= KW_D7)
+ if (*tok >= KW_D0 && *tok <= KW_D7)
{
// Dx,Dy,#<adjustment>
inst |= (0 << 3); // R/M
- inst |= (*tok.u32++ & 7);
+ inst |= (*tok++ & 7);
- if (*tok.u32 != ',' && tok.u32[2] != ',')
+ if (*tok != ',' && tok[2] != ',')
return error("missing comma");
- if (tok.u32[1] < KW_D0 && tok.u32[1] > KW_D7)
+ if (tok[1] < KW_D0 && tok[1] > KW_D7)
return error(syntax_error);
- inst |= ((tok.u32[1] & 7)<<9);
- tok.u32 = tok.u32 + 3;
+ inst |= ((tok[1] & 7)<<9);
+ tok = tok + 3;
D_word(inst);
// Fall through for adjustment (common in both valid cases)
}
- else if (*tok.u32 == '-')
+ else if (*tok == '-')
{
// -(Ax),-(Ay),#<adjustment>
inst |= (1 << 3); // R/M
- tok.u32++; // eat the minus
+ tok++; // eat the minus
- if ((*tok.u32 != '(') && (tok.u32[2]!=')') && (tok.u32[3]!=',') && (tok.u32[4] != '-') && (tok.u32[5] != '(') && (tok.u32[7] != ')') && (tok.u32[8] != ','))
+ if ((*tok != '(') && (tok[2]!=')') && (tok[3]!=',') && (tok[4] != '-') && (tok[5] != '(') && (tok[7] != ')') && (tok[8] != ','))
return error(syntax_error);
- if (tok.u32[1] < KW_A0 && tok.u32[1] > KW_A7)
+ if (tok[1] < KW_A0 && tok[1] > KW_A7)
return error(syntax_error);
- if (tok.u32[5] < KW_A0 && tok.u32[6] > KW_A7)
+ if (tok[5] < KW_A0 && tok[6] > KW_A7)
return error(syntax_error);
- inst |= ((tok.u32[1] & 7) << 0);
- inst |= ((tok.u32[6] & 7) << 9);
- tok.u32 = tok.u32 + 9;
+ inst |= ((tok[1] & 7) << 0);
+ inst |= ((tok[6] & 7) << 9);
+ tok = tok + 9;
D_word(inst);
// Fall through for adjustment (common in both valid cases)
}
else
return error("invalid syntax");
- if ((*tok.u32 != CONST) && (*tok.u32 != SYMBOL) && (*tok.u32 != '-'))
+ if ((*tok != CONST) && (*tok != SYMBOL) && (*tok != '-'))
return error(syntax_error);
- if (expr((TOKENPTR)a0expr, &a0exval, &a0exattr, &a0esym) == ERROR)
+ if (expr(a0expr, &a0exval, &a0exattr, &a0esym) == ERROR)
return ERROR;
if ((a0exattr & DEFINED) == 0)
if (a0exval + 0x8000 > 0x10000)
return error("");
- if (*tok.u32 != EOL)
+ if (*tok != EOL)
return error(extra_stuff);
D_word((a0exval & 0xFFFF));
// PFLUSH FC, MASK, < ea >
WORD mask, fc;
- switch ((int)*tok.u32)
+ switch ((int)*tok)
{
case '#':
- tok.u32++;
+ tok++;
- if (*tok.u32 != CONST && *tok.u32 != SYMBOL)
+ if (*tok != CONST && *tok != SYMBOL)
return error("function code should be an expression");
- if (expr((TOKENPTR)a0expr, &a0exval, &a0exattr, &a0esym) == ERROR)
+ if (expr(a0expr, &a0exval, &a0exattr, &a0esym) == ERROR)
return ERROR;
if ((a0exattr & DEFINED) == 0)
case KW_D5:
case KW_D6:
case KW_D7:
- fc = (1 << 4) | (*tok.u32++ & 7);
+ fc = (1 << 4) | (*tok++ & 7);
break;
case KW_SFC:
fc = 0;
- tok.u32++;
+ tok++;
break;
case KW_DFC:
fc = 1;
- tok.u32++;
+ tok++;
break;
default:
return error(syntax_error);
}
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("comma exptected");
- if (*tok.u32++ != '#')
+ if (*tok++ != '#')
return error("mask should be an immediate value");
- if (*tok.u32 != CONST && *tok.u32 != SYMBOL)
+ if (*tok != CONST && *tok != SYMBOL)
return error("mask is supposed to be immediate");
- if (expr((TOKENPTR)a0expr, &a0exval, &a0exattr, &a0esym) == ERROR)
+ if (expr(a0expr, &a0exval, &a0exattr, &a0esym) == ERROR)
return ERROR;
if ((a0exattr & DEFINED) == 0)
mask = (uint16_t)a0exval << 5;
- if (*tok.u32 == EOL)
+ if (*tok == EOL)
{
// PFLUSH FC, MASK
D_word(inst);
D_word(inst);
return OK;
}
- else if (*tok.u32 == ',')
+ else if (*tok == ',')
{
// PFLUSH FC, MASK, < ea >
- tok.u32++;
+ tok++;
if (amode(0) == ERROR)
return ERROR;
- if (*tok.u32 != EOL)
+ if (*tok != EOL)
return error(extra_stuff);
if (am0 == AIND || am0 == ABSW || am0 == ABSL || am0 == ADISP || am0 == ADISP || am0 == AINDEXED || am0 == ABASE || am0 == MEMPOST || am0 == MEMPRE)
{
// PFLUSH(An)
// PFLUSHN(An)
- if (*tok.u32 != '(' && tok.u32[2] != ')')
+ if (*tok != '(' && tok[2] != ')')
return error(syntax_error);
- if (tok.u32[1] < KW_A0 && tok.u32[1] > KW_A7)
+ if (tok[1] < KW_A0 && tok[1] > KW_A7)
return error("expected (An)");
if ((inst & 7) == 7)
// pflushn inside 68ktab and detect it here.
inst = (inst & 0xff8) | 8;
- inst |= (tok.u32[1] & 7) | (5 << 8);
+ inst |= (tok[1] & 7) | (5 << 8);
- if (tok.u32[3] != EOL)
+ if (tok[3] != EOL)
return error(extra_stuff);
D_word(inst);
}
else
{
- AddFixup(FU_WORD | FU_PCREL | FU_ISBRA, sloc, (TOKENPTR)a1expr);
+ AddFixup(FU_WORD | FU_PCREL | FU_ISBRA, sloc, a1expr);
D_word(0);
}
if (siz == SIZX || siz==SIZN)
{
- if ((*tok.u32 >= KW_FP0) && (*tok.u32 <= KW_FP7))
+ if ((*tok >= KW_FP0) && (*tok <= KW_FP7))
{
//fmovem.x <rlist>,ea
if (fpu_reglist_left(®mask) < 0)
return OK;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
if (amode(0) < 0)
ea0gen(siz);
return OK;
}
- else if ((*tok.u32 >= KW_D0) && (*tok.u32 <= KW_D7))
+ else if ((*tok >= KW_D0) && (*tok <= KW_D7))
{
// fmovem.x Dn,ea
- datareg = (*tok.u32++ & 7) << 10;
+ datareg = (*tok++ & 7) << 10;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
if (amode(0) < 0)
inst |= am0 | a0reg;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
- if ((*tok.u32 >= KW_FP0) && (*tok.u32 <= KW_FP7))
+ if ((*tok >= KW_FP0) && (*tok <= KW_FP7))
{
//fmovem.x ea,<rlist>
if (fpu_reglist_right(®mask) < 0)
else
{
// fmovem.x ea,Dn
- datareg = (*tok.u32++ & 7) << 10;
+ datareg = (*tok++ & 7) << 10;
D_word(inst);
inst = (1 << 15) | (1 << 14) | (0 << 13) | (3 << 11) | (datareg << 4);
D_word(inst);
}
else if (siz == SIZL)
{
- if ((*tok.u32 == KW_FPCR) || (*tok.u32 == KW_FPSR) || (*tok.u32 == KW_FPIAR))
+ if ((*tok == KW_FPCR) || (*tok == KW_FPSR) || (*tok == KW_FPIAR))
{
//fmovem.l <rlist>,ea
regmask = (1 << 15) | (1 << 13);
fmovem_loop_1:
- if (*tok.u32 == KW_FPCR)
+ if (*tok == KW_FPCR)
{
regmask |= (1 << 12);
- tok.u32++;
+ tok++;
goto fmovem_loop_1;
}
- if (*tok.u32 == KW_FPSR)
+ if (*tok == KW_FPSR)
{
regmask |= (1 << 11);
- tok.u32++;
+ tok++;
goto fmovem_loop_1;
}
- if (*tok.u32 == KW_FPIAR)
+ if (*tok == KW_FPIAR)
{
regmask |= (1 << 10);
- tok.u32++;
+ tok++;
goto fmovem_loop_1;
}
- if ((*tok.u32 == '/') || (*tok.u32 == '-'))
+ if ((*tok == '/') || (*tok == '-'))
{
- tok.u32++;
+ tok++;
goto fmovem_loop_1;
}
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
if (amode(0) < 0)
inst |= am0 | a0reg;
- if (*tok.u32++ != ',')
+ if (*tok++ != ',')
return error("missing comma");
regmask = (1 << 15) | (0 << 13);
fmovem_loop_2:
- if (*tok.u32 == KW_FPCR)
+ if (*tok == KW_FPCR)
{
regmask |= (1 << 12);
- tok.u32++;
+ tok++;
goto fmovem_loop_2;
}
- if (*tok.u32 == KW_FPSR)
+ if (*tok == KW_FPSR)
{
regmask |= (1 << 11);
- tok.u32++;
+ tok++;
goto fmovem_loop_2;
}
- if (*tok.u32 == KW_FPIAR)
+ if (*tok == KW_FPIAR)
{
regmask |= (1 << 10);
- tok.u32++;
+ tok++;
goto fmovem_loop_2;
}
- if ((*tok.u32 == '/') || (*tok.u32 == '-'))
+ if ((*tok == '/') || (*tok == '-'))
{
- tok.u32++;
+ tok++;
goto fmovem_loop_2;
}
- if (*tok.u32 != EOL)
+ if (*tok != EOL)
return error("extra (unexpected) text found");
inst |= am0 | a0reg;