summaryrefslogtreecommitdiff
path: root/usr.bin/oasm/parse.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-22 01:39:20 -0400
committerIan Moffett <ian@osmora.org>2025-07-22 01:39:20 -0400
commitdf9f396017f92ad4647697d461bb5475d6596cfb (patch)
tree134b61150abea3c3e848486af31a5966a77c9661 /usr.bin/oasm/parse.c
parentcf0acae537a4664948485bc9e9a370fe7d100803 (diff)
oasm: Add encoding logic for "SUB" instruction
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/parse.c')
-rw-r--r--usr.bin/oasm/parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c
index 6851935..cefe812 100644
--- a/usr.bin/oasm/parse.c
+++ b/usr.bin/oasm/parse.c
@@ -109,6 +109,7 @@ parse_reg(struct oasm_state *state, struct oasm_token *tok)
case TT_DEC:
case TT_INC:
case TT_ADD:
+ case TT_SUB:
state->last = tok->type;
break;
default:
@@ -152,6 +153,10 @@ parse_tok(struct oasm_state *state, struct oasm_token *tok)
state->last = tok->type;
emit_osxm64(&emit_state, tok);
break;
+ case TT_SUB:
+ state->last = tok->type;
+ emit_osxm64(&emit_state, tok);
+ break;
case TT_DEC:
case TT_INC:
state->last = tok->type;