summaryrefslogtreecommitdiff
path: root/usr.bin/oasm/lex.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-20 21:58:24 -0400
committerIan Moffett <ian@osmora.org>2025-07-20 21:59:18 -0400
commit7a43fb95afa4cee74b2282f38789bbc363b86dd7 (patch)
treefcda49151fb2df0918629fcd84d40ed0e1078e60 /usr.bin/oasm/lex.c
parent60ceb932fd0889690fef6883361eaf81cbf7ffae (diff)
oasm: lex: Convert and store <imm> to uint16_t
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/lex.c')
-rw-r--r--usr.bin/oasm/lex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/oasm/lex.c b/usr.bin/oasm/lex.c
index c2a7a1f..f8427e0 100644
--- a/usr.bin/oasm/lex.c
+++ b/usr.bin/oasm/lex.c
@@ -297,6 +297,10 @@ lex_tok(struct oasm_state *state, struct oasm_token *ttp)
/* Immediate operand? */
if ((tok = token_operand(p)) != TT_UNKNOWN) {
+ if (tok == TT_IMM) {
+ ttp->imm = atoi(&p[1]);
+ }
+
ttp->type = tok;
ttp->raw = p;
return 0;