1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-09 14:29:29 +00:00

evaluate casts only at start of expression, ignore in the middle

This commit is contained in:
Andre Fachat 2023-10-10 15:46:10 +02:00
parent 9052c38108
commit 4dea17ea26
2 changed files with 6 additions and 3 deletions

View File

@ -138,8 +138,11 @@ printf("ag_term(%02x %02x %02x %02x %02x %02x\n",s[0],s[1],s[2],s[3],s[4],s[5]);
pp+=3;
}
else
if(s[pp]==T_VALUE)
if(s[pp]==T_VALUE || s[pp] == T_CAST)
{
while (s[pp] == T_CAST) {
pp+=2;
}
*v=lval(s+pp+1);
pp+=5;
/*
@ -162,7 +165,7 @@ printf("pointer: v=%04x, afl=%04x\n",*v,afl);
*v=pcc;
pp++;
afl = segment;
}
}
else {
er=E_SYNTAX;
}

View File

@ -897,6 +897,7 @@ fprintf(stderr, "E_NODEF pass1 xat.c\n");
/* optimize operand length for 24-bit quantities */
/* look at cast byte from t_conv */
if (cast!='@' && cast!= '!')
{
if(bl && !er && opt[am]>=0 && am>16) /* <<< NOTE! */
@ -2179,7 +2180,6 @@ static int t_conv(signed char *s, signed char *t, int *l, int pc, int *nk,
{
t[q++]=T_CAST;
t[q++]=s[p];
/*cast=s[p];*/
operand= -operand+1;
p++;
} else