diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-22 02:42:46 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-22 02:42:46 -0400 |
commit | fa2bb7b2a5cc01c3c28c9dcd34cf65a499321b9c (patch) | |
tree | 56bd3b316a2cc9091b782a34edfc27350e11517c /usr.bin/oasm/emit.c | |
parent | d3f8d2baa9e2cd8d35187d0e22155b5437947bf7 (diff) |
oasm: Add encoding logic for "DIV" instruction
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/emit.c')
-rw-r--r-- | usr.bin/oasm/emit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/oasm/emit.c b/usr.bin/oasm/emit.c index 83dbe46..0e8ad4e 100644 --- a/usr.bin/oasm/emit.c +++ b/usr.bin/oasm/emit.c @@ -194,6 +194,10 @@ emit_encode_arith(struct emit_state *state, struct oasm_token *tok) inst_str = "mul"; opcode = OSMX64_MUL; break; + case TT_DIV: + inst_str = "div"; + opcode = OSMX64_DIV; + break; } /* @@ -334,6 +338,7 @@ emit_process(struct oasm_state *oasm, struct emit_state *emit) case TT_ADD: case TT_SUB: case TT_MUL: + case TT_DIV: curtok = emit_encode_arith(emit, curtok); break; case TT_HLT: |