diff options
author | Ori Bernstein <ori@eigenstate.org> | 2016-02-28 20:02:36 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2016-02-28 20:16:20 -0800 |
commit | 50c5af4290aed32a7733768c1bee2e64c93a7f84 (patch) | |
tree | ee2d1b70942006735e3d8af44ab38de43c94818a /lisc/emit.c | |
parent | ec7c4e0d60e22c10b6f7817436bd3f4abf2d5356 (diff) | |
download | roux-50c5af4290aed32a7733768c1bee2e64c93a7f84.tar.gz |
Allow trailing and ',' and references in data.
This change adds support for two things: data $foo {l 123,} Which allows easier machine generation of data statements. It also adds the ability to parse and emit references in data declarations.
Diffstat (limited to 'lisc/emit.c')
-rw-r--r-- | lisc/emit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisc/emit.c b/lisc/emit.c index 876d9ef..d0599a4 100644 --- a/lisc/emit.c +++ b/lisc/emit.c @@ -553,7 +553,10 @@ emitdat(Dat *d, FILE *f) fprintf(f, "\t.asciz \"%s\"\n", d->u.str); break; default: - fprintf(f, "%s %"PRId64"\n", dtoa[d->type], d->u.num); + if (d->isref) + fprintf(f, "%s %s+%"PRId64"\n", dtoa[d->type], d->u.ref.nam, d->u.ref.off); + else + fprintf(f, "%s %"PRId64"\n", dtoa[d->type], d->u.num); break; } } |