1
0
mirror of https://github.com/fachat/xa65.git synced 2024-11-03 06:05:58 +00:00

fix a nasty one-off bug giving a syntax error on *= assignments

This commit is contained in:
A. Fachat 2011-12-28 20:38:12 +01:00
parent 61f81d4e5e
commit 05c7799e9b
3 changed files with 19 additions and 7 deletions

View File

@ -894,6 +894,7 @@ static void usage(int default816, FILE *fp)
fprintf(fp,
" -e filename sets errorlog filename, default is none\n"
" -l filename sets labellist filename, default is none\n"
" -P filename sets filename for listing, default is none, '-' is stdout\n"
" -r adds crossreference list to labellist (if `-l' given)\n"
" -M allow ``:'' to appear in comments for MASM compatibility\n"
" -Xcompatset set compatibility flags for other assemblers, known values are:\n"
@ -901,6 +902,7 @@ static void usage(int default816, FILE *fp)
" -R start assembler in relocating mode\n");
fprintf(fp,
" -Llabel defines `label' as absolute, undefined label even when linking\n"
" -p<c> replace preprocessor char '#' with custom, e.g. '-p%' replaces it with '%'\n"
" -b? addr set segment base address to integer value addr\n"
" `?' stands for t(ext), d(ata), b(ss) and z(ero) segment\n"
" (address can be given more than once, last one is used)\n");

View File

@ -206,10 +206,18 @@ static int get_op(signed char *s, int *o)
*o=s[pp];
if(*o<1 || *o>17)
if(*o<1 || *o>17) {
/*
printf("*o=%d, pp=%d, s=%s\n", *o, pp, s);
for (int i=0; i< 10; i++) {
printf(" %02x", s[i]);
}
printf("\n");
*/
er=E_SYNTAX;
else
} else {
er=E_OK;
}
return(er);
}

View File

@ -492,14 +492,14 @@ fprintf(stderr, "- p1 %d starting -\n", pc[segment]);
if(!(er=a_term(t+1,&tmp /*&pc[SEG_ABS]*/,&l,pc[segment],&afl,&label,0)))
{
i=1;
wval(i,tmp /*pc[SEG_ABS]*/, 0);
wval(i,tmp /*pc[SEG_ABS]*/, 0); /* writes T_VALUE, 3 bytes value, plus one byte */
t[i++]=T_END;
*ll=6;
*ll=7;
er=E_OKDEF;
/*printf("set pc=%04x, oldsegment=%d, pc[segm]=%04x, ",
pc[SEG_ABS], segment, pc[segment]);
printf(" wrote %02x %02x %02x %02x %02x %02x\n",
t[0],t[1],t[2],t[3],t[4],t[5]);*/
printf(" wrote %02x %02x %02x %02x %02x %02x, %02x, %02x\n",
t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]);*/
if(segment==SEG_TEXT) {
pc[SEG_ABS] = tmp;
r_mode(RMODE_ABS);
@ -2482,9 +2482,11 @@ void list_filename(char *fname) {
list_last_lineno = 0;
/* Hack */
if (listfp != NULL) {
fprintf(listfp, "\n%s\n\n", fname);
}
}
}
/**
* set the output file descriptor where to write the listing