diff --git a/xa/src/xa.c b/xa/src/xa.c index 9f1d74c..5a3d0a3 100644 --- a/xa/src/xa.c +++ b/xa/src/xa.c @@ -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 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"); diff --git a/xa/src/xaa.c b/xa/src/xaa.c index 2f4dcaa..ffedbe5 100644 --- a/xa/src/xaa.c +++ b/xa/src/xaa.c @@ -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); } diff --git a/xa/src/xat.c b/xa/src/xat.c index 39b5793..56e3d4a 100644 --- a/xa/src/xat.c +++ b/xa/src/xat.c @@ -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,7 +2482,9 @@ void list_filename(char *fname) { list_last_lineno = 0; /* Hack */ - fprintf(listfp, "\n%s\n\n", fname); + if (listfp != NULL) { + fprintf(listfp, "\n%s\n\n", fname); + } } }