summaryrefslogtreecommitdiff
path: root/nqasm.h
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-18 19:40:18 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-18 19:40:18 -0600
commit6c6b91f9a6bc5ae203e99ac7abb3a70215488a6f (patch)
treea60ee21b204363128001cf323e5914745a630afd /nqasm.h
parent1e0d0202e614f398f491624c84ae9a8309fa2f96 (diff)
nqasm: support unary operators in immediate expressions
Diffstat (limited to 'nqasm.h')
-rw-r--r--nqasm.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/nqasm.h b/nqasm.h
index 0bc51f7..e5a7452 100644
--- a/nqasm.h
+++ b/nqasm.h
@@ -1,15 +1,23 @@
#ifndef NQ_NQASM_H
#define NQ_NQASM_H
-#define ARG_INTEGER 0
-#define ARG_LABEL 1
-#define ARG_PC 2
+enum {
+ ARG_INTEGER,
+ ARG_LABEL,
+ ARG_PC,
+
+ ARG_UNARY_ADD,
+ ARG_UNARY_SUB,
+ ARG_UNARY_NOT,
+ ARG_UNARY_INV,
+};
struct argument {
int type;
union {
long value;
char *label;
+ const struct argument *children[1];
};
};
@@ -25,5 +33,7 @@ struct instruction {
void add_instruction(const struct instruction *);
void add_label(const char *);
+struct argument *argdup(const struct argument *);
+
#endif