X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fassemble.c;h=7966ea9c1b3bec45eff2668c72a693a09ca8f3a0;hb=756f119336f5433a85df0036971256b289d5a35a;hp=b9fbed7133218e630879000964515f85cfec536f;hpb=04a3118439bbcea335da98764406256d10be78f5;p=YACASL2.git diff --git a/src/assemble.c b/src/assemble.c index b9fbed7..7966ea9 100644 --- a/src/assemble.c +++ b/src/assemble.c @@ -143,7 +143,7 @@ bool assemblecmd(const CMDLINE *cmdl, PASS pass) CMDARRAY ascmd[] = { { START, 0, 1, "START" }, { END, 0, 0, "END" }, - { DC, 0, OPDSIZE, "DC" }, + { DC, 1, OPDSIZE, "DC" }, { DS, 1, 1, "DS" }, { 0, 0, 0, NULL } }; @@ -395,10 +395,6 @@ bool assembleline(const CMDLINE *cmdl, PASS pass) return status; } -void printline(FILE *stream, const char *filename, int lineno, char *line) { - fprintf(stream, "%s:%5d:%s", filename, lineno, line); -} - /* 指定された名前のファイルをアセンブル */ /* 2回実行される */ bool assemble(const char *file, PASS pass) @@ -426,7 +422,7 @@ bool assemble(const char *file, PASS pass) if((pass == FIRST && (&asmode)->src == true) || (pass == SECOND && (&asmode)->asdetail == true)) { - printline(stdout, file, lineno, line); + fprintf(stdout, "%s:%5d:%s", file, lineno, line); } if((cmdl = linetok(line)) != NULL) { if(pass == FIRST && cmdl->label != NULL) { @@ -443,8 +439,7 @@ bool assemble(const char *file, PASS pass) } } if(cerrno > 0) { - fprintf(stderr, "Assemble error - %d: %s\n", cerrno, cerrmsg); - printline(stderr, file, lineno, line); + fprintf(stderr, "Assemble error - %d: %s\n %s:%d: %s\n", cerrno, cerrmsg, file, lineno, line); status = false; } fclose(fp);