Print error messages to stderr, redirect debug messages to file

This commit is contained in:
Curtis F Kaylor 2018-02-08 22:39:20 -05:00
parent 1cc877717a
commit 1ef4cfc25d
5 changed files with 7 additions and 2 deletions

BIN
c02.exe

Binary file not shown.

BIN
c02.tag

Binary file not shown.

View File

@ -13,7 +13,7 @@
/* Error - Print Input File name & position and exit */
void exterr(int errnum)
{
printf("Line %d Column %d of File %s\n", curlin, curcol, inpnam);
fprintf(stderr, "Line %d Column %d of File %s\n", curlin, curcol, inpnam);
exit(errnum);
}

View File

@ -35,7 +35,7 @@
#define DEBUG(fmt, val) if (debug) {prtpos(); printf(fmt, val);}
#define DETAIL(fmt, val) if (debug) {printf(fmt, val);}
#define ERROR(fmt, val, err) if (debug) {printf(fmt, val);exterr(err);}
#define ERROR(fmt, val, err) if (debug) {fprintf(stderr, fmt, val);exterr(err);}
#define SCMNT(str) if (gencmt) {setcmt(str);}
#define ACMNT(str) if (gencmt) {addcmt(str);}
#define CCMNT(chr) if (gencmt) {chrcmt(chr);}

5
py65/c02.bat Normal file
View File

@ -0,0 +1,5 @@
@ECHO Compiling File %1.c02
..\c02.exe %1 >%1.dbg
@ECHO Assembling File %1.asm
C:\Programs\dasm %1.asm -f3 -o%1.bin -l%1.lst -s%1.sym