scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit d2262468e06da67413347597c9f15469e945f1be
parent 642bd886398e144a79c311d31c9ce7381e675f10
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 16 Dec 2017 21:27:04 +0100

[as] Add end pseudo instruction

This pseudo instruction finishes the processing of the current
file. It allows to add free format comments after it.

Diffstat:
Mas/as.h | 1+
Mas/ins.c | 6++++++
Mas/main.c | 4+++-
Mas/target/x80/x80.dat | 1+
4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/as/as.h b/as/as.h @@ -195,3 +195,4 @@ extern TUINT maxaddr; extern int endian; extern Symbol *linesym, *symlist; extern char *infile; +extern int endpass; diff --git a/as/ins.c b/as/ins.c @@ -235,3 +235,9 @@ align(Op *op, Node **args) for (al = pc - curpc; al > 0; --al) emit((char []) {0}, 1); } + +void +end(Op *op, Node **args) +{ + endpass = 1; +} diff --git a/as/main.c b/as/main.c @@ -12,6 +12,7 @@ static char sccsid[] = "@(#) ./as/main.c"; char *argv0; char *outfile, *infile; +int endpass; static void @@ -77,8 +78,9 @@ dopass(char *fname) die("as: error opening '%s'", fname); cleansecs(); + endpass = 0; setjmp(recover); - while (nextline(fp, &line)) { + while (!endpass && nextline(fp, &line)) { linesym = NULL; if (line.label) diff --git a/as/target/x80/x80.dat b/as/target/x80/x80.dat @@ -31,6 +31,7 @@ .STRING string+ 0 none string Z80,R800,GB80 .ASCII string+ 0 none ascii Z80,R800,GB80 .ALIGN imm16+ 0 none align Z80,R800,GB80 +.END none 0 none end Z80,R800,GB80 NOP none 1 0x00 noargs Z80,R800,GB80 EI none 1 0xfb noargs Z80,R800,GB80