summaryrefslogtreecommitdiff
path: root/lexer.l
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-18 19:20:20 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-18 19:20:20 -0600
commit1e0d0202e614f398f491624c84ae9a8309fa2f96 (patch)
tree1000df0a8eb39453ac48a14809dd250230f67e6c /lexer.l
parent2e0de3cc53d031ac2fa48eddc9a472b0e4c34a45 (diff)
nqasm: allow "." to refer to current pc in immediate operand
Diffstat (limited to 'lexer.l')
-rw-r--r--lexer.l1
1 files changed, 1 insertions, 0 deletions
diff --git a/lexer.l b/lexer.l
index 5c8ebfb..053ac4e 100644
--- a/lexer.l
+++ b/lexer.l
@@ -74,6 +74,7 @@ HEX [0-9a-f]
<inst>addpc/{EOI} { BEGIN(args); return T_ADDPC; }
<inst>nop/{EOI} { BEGIN(args); return T_NOP; }
+<args>\. { return T_DOT; }
<args>@ { return T_DEREF; }
<args>[-+]?{DEC}+ { return intlit(yytext, 10, &yylval.lval); }
<args>0x{HEX}+ { return intlit(yytext+2, 16, &yylval.lval); }