From a4a7080dee359ca95f09d91d68d1d8c4a1f59cd6 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 27 Jul 2025 22:59:18 -0400 Subject: oasm: Introduce AND mnemonic Implement mnemonic for the AND instruction: -- and x1, #7 ! x1 = x1 & 7 -- Signed-off-by: Ian Moffett --- usr.bin/oasm/lex.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usr.bin/oasm/lex.c') diff --git a/usr.bin/oasm/lex.c b/usr.bin/oasm/lex.c index fea9dc3..220cdb4 100644 --- a/usr.bin/oasm/lex.c +++ b/usr.bin/oasm/lex.c @@ -54,6 +54,7 @@ static char putback = '\0'; #define S_IMN_MROW "mrow" #define S_IMN_MROD "mrod" #define S_IMN_MROQ "mroq" +#define S_IMN_AND "and" /* Instruction length */ #define OSMX64_INST_LEN 4 @@ -242,6 +243,8 @@ token_bitw_mro(char *p) return TT_MROD; } else if (strcmp(p, S_IMN_MROQ) == 0) { return TT_MROQ; + } else if (strcmp(p, S_IMN_AND) == 0) { + return TT_AND; } return TT_UNKNOWN; -- cgit v1.2.3