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/parse.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'usr.bin/oasm/parse.c') diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c index b4bb7be..ce5a446 100644 --- a/usr.bin/oasm/parse.c +++ b/usr.bin/oasm/parse.c @@ -60,6 +60,7 @@ static const char *tokstr[] = { [ TT_MROQ ] = "mroq", [ TT_AND ] = "and", [ TT_OR ] = "or", + [ TT_XOR ] = "xor", /* X registers */ [ TT_X0 ] = "x0", @@ -126,6 +127,8 @@ parse_reg(struct oasm_state *state, struct oasm_token *tok) case TT_DIV: case TT_BR: case TT_AND: + case TT_OR: + case TT_XOR: state->last = tok->type; break; default: @@ -176,6 +179,10 @@ parse_tok(struct oasm_state *state, struct oasm_token *tok) state->last = tok->type; emit_osmx64(&emit_state, tok); break; + case TT_XOR: + state->last = tok->type; + emit_osmx64(&emit_state, tok); + break; case TT_HLT: state->last = tok->type; emit_osmx64(&emit_state, tok); -- cgit v1.2.3