commit 542d89bcd50a0dd43a490180547c88312bf0c7a6
parent 8a9b0c551366d1b16ae6ddbe72c8480d9df0a736
Author: Ori Bernstein <ori@eigenstate.org>
Date: Sun, 28 Feb 2016 20:39:41 -0800
Add zero fill data.
Diffstat:
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lisc/emit.c b/lisc/emit.c
@@ -549,6 +549,9 @@ emitdat(Dat *d, FILE *f)
d->u.str, d->u.str, d->u.str
);
break;
+ case DZ:
+ fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num);
+ break;
case DB:
if (d->isstr) {
fprintf(f, "\t.ascii \"%s\"\n", d->u.str);
diff --git a/lisc/lisc.h b/lisc/lisc.h
@@ -432,7 +432,8 @@ struct Dat {
DB,
DH,
DW,
- DL
+ DL,
+ DZ
} type;
union {
int64_t num;
diff --git a/lisc/parse.c b/lisc/parse.c
@@ -87,6 +87,7 @@ enum {
TB,
TD,
TS,
+ TZ,
TPlus,
@@ -175,6 +176,7 @@ lex()
{ "b", TB },
{ "d", TD },
{ "s", TS },
+ { "z", TZ },
{ "loadw", OLoad }, /* for convenience */
{ "loadl", OLoad },
{ "loads", OLoad },
@@ -827,6 +829,7 @@ parsedat(void cb(Dat *))
case TB: d.type = DB; break;
case TS: d.type = DW; break;
case TD: d.type = DL; break;
+ case TZ: d.type = DZ; break;
}
t = nextnl();
do {