commit 11a557fc44cb50172c5ae35b701a35e4265b1a35
parent de7c12f6f60a817c25ddff8488f55ed496987155
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 27 Sep 2017 22:34:22 +0200
[as] Add skeleton to check size of IMM operands
At this moment this check is not performed, but the call to
the correct function is added.
Diffstat:
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/as/as.h b/as/as.h
@@ -108,6 +108,7 @@ extern void emit(Section *sec, char *bytes, int nbytes);
extern Section *section(char *name);
extern Symbol *tmpsym(TUINT val);
extern void killtmp(void);
+extern int toobig(Node *np, int type);
/* main.c */
extern Symbol *lookup(char *name, int type);
diff --git a/as/symbol.c b/as/symbol.c
@@ -115,6 +115,13 @@ deflabel(char *name)
return sym;
}
+int
+toobig(Node *np, int type)
+{
+ /* TODO */
+ return 0;
+}
+
char *
pack(TUINT v, int n, int inc)
{
diff --git a/as/target/z80/proc.c b/as/target/z80/proc.c
@@ -71,6 +71,8 @@ match(Op *op, Node **args)
np = *args++;
if (np->addr != AIMM)
return 0;
+ if (toobig(np, arg))
+ return 0;
break;
default:
abort();