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)
if((pass == FIRST && (&asmode)->src == true) ||
(pass == SECOND && (&asmode)->asdetail == true))
{
- fprintf(stdout, "%s:%5d:%s", file, lineno, line);
+ printline(stdout, file, lineno, line);
}
if((cmdl = linetok(line)) != NULL) {
if(pass == FIRST && cmdl->label != NULL) {
}
}
if(cerrno > 0) {
- fprintf(stderr, "Assemble error - %d: %s\n %s:%d: %s\n", cerrno, cerrmsg, file, lineno, line);
+ fprintf(stderr, "Assemble error - %d: %s\n", cerrno, cerrmsg);
+ printline(stderr, file, lineno, line);
status = false;
}
fclose(fp);
../../../../as/ERR/cmd_err0.casl: 3: LAD GR2,2
../../../../as/ERR/cmd_err0.casl: 4: LEA GR1,GR2
Assemble error - 109: LEA: not command of operand "r1,r2"
- ../../../../as/ERR/cmd_err0.casl:4: LEA GR1,GR2
-
+../../../../as/ERR/cmd_err0.casl: 4: LEA GR1,GR2
../../../../as/ERR/cmd_err1.casl: 1:MAIN START BEGIN
../../../../as/ERR/cmd_err1.casl: 2:BEGIN LEA GR1,A
Assemble error - 110: LEA: not command of operand "r,adr[,x]"
- ../../../../as/ERR/cmd_err1.casl:2: BEGIN LEA GR1,A
-
+../../../../as/ERR/cmd_err1.casl: 2:BEGIN LEA GR1,A
../../../../as/ERR/ds_err.casl: 3: ST GR0,A
../../../../as/ERR/ds_err.casl: 4:A DS
Assemble error - 106: operand count mismatch
- ../../../../as/ERR/ds_err.casl:4: A DS
-
+../../../../as/ERR/ds_err.casl: 4:A DS
../../../../as/ERR/labeldup_err.casl: 5:A DC 3
../../../../as/ERR/labeldup_err.casl: 6:A DC 1
Assemble error - 101: A: label already defined
- ../../../../as/ERR/labeldup_err.casl:6: A DC 1
-
+../../../../as/ERR/labeldup_err.casl: 6:A DC 1
Assemble ../../../../as/ERR/literalstr_err.casl (0)
Assemble error - 124: 'abcdeABCDE': more than one character in literal
- ../../../../as/ERR/literalstr_err.casl:2: LAD GR1,='abcdeABCDE'
-
+../../../../as/ERR/literalstr_err.casl: 2: LAD GR1,='abcdeABCDE'
../../../../as/ERR/opdspc_err.casl: 1:MAIN START BEGIN
../../../../as/ERR/opdspc_err.casl: 2:BEGIN LD GR1, A
Assemble error - 121: cannot get operand token
- ../../../../as/ERR/opdspc_err.casl:2: BEGIN LD GR1, A
-
+../../../../as/ERR/opdspc_err.casl: 2:BEGIN LD GR1, A
Assemble ../../../../as/ERR/quoteend_err.casl (0)
Assemble error - 123: 'Hello, World!: unclosed quote
- ../../../../as/ERR/quoteend_err.casl:4: BUF DC 'Hello, World!
-
+../../../../as/ERR/quoteend_err.casl: 4:BUF DC 'Hello, World!