From 0d5a742b653870e742b3565389743bbccb39851d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 27 Jul 2025 23:25:08 -0400 Subject: oasm: Introduce XOR mnemonic Implement mnemonic for the XOR instruction: -- xor x4, #1 ! x4 = x4 ^ 1 -- Signed-off-by: Ian Moffett --- usr.bin/oasm/emit.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr.bin/oasm/emit.c') diff --git a/usr.bin/oasm/emit.c b/usr.bin/oasm/emit.c index ebbd824..63f716a 100644 --- a/usr.bin/oasm/emit.c +++ b/usr.bin/oasm/emit.c @@ -398,6 +398,10 @@ emit_encode_bitw(struct emit_state *state, struct oasm_token *tok) opcode = OSMX64_OR; inst_str = "or"; break; + case TT_XOR: + opcode = OSMX64_XOR; + inst_str = "xor"; + break; } /* Next token should be a register */ @@ -527,6 +531,7 @@ emit_process(struct oasm_state *oasm, struct emit_state *emit) break; case TT_AND: case TT_OR: + case TT_XOR: curtok = emit_encode_bitw(emit, curtok); break; case TT_BR: -- cgit v1.2.3