summaryrefslogtreecommitdiff
path: root/usr.bin/oasm/emit.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-22 02:34:25 -0400
committerIan Moffett <ian@osmora.org>2025-07-22 02:34:25 -0400
commitea521725a7739ec568eb6961edabf71d8169ef9e (patch)
tree22a61a45448455d16c8c5196bb6cc4101edc9a10 /usr.bin/oasm/emit.c
parentc774776241f7b20ae40b432c11d0d161b75d2e79 (diff)
oasm: Introduce encoding for MUL instruction
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/emit.c')
-rw-r--r--usr.bin/oasm/emit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/oasm/emit.c b/usr.bin/oasm/emit.c
index 80adba9..83dbe46 100644
--- a/usr.bin/oasm/emit.c
+++ b/usr.bin/oasm/emit.c
@@ -190,6 +190,10 @@ emit_encode_arith(struct emit_state *state, struct oasm_token *tok)
inst_str = "sub";
opcode = OSMX64_SUB;
break;
+ case TT_MUL:
+ inst_str = "mul";
+ opcode = OSMX64_MUL;
+ break;
}
/*
@@ -329,6 +333,7 @@ emit_process(struct oasm_state *oasm, struct emit_state *emit)
break;
case TT_ADD:
case TT_SUB:
+ case TT_MUL:
curtok = emit_encode_arith(emit, curtok);
break;
case TT_HLT: