summaryrefslogtreecommitdiff
path: root/usr.bin/oasm/lex.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-27 22:59:18 -0400
committerIan Moffett <ian@osmora.org>2025-07-28 03:30:58 -0400
commita4a7080dee359ca95f09d91d68d1d8c4a1f59cd6 (patch)
treeea3a16a62d1c2bd4426273f8e28907f20c6e69ff /usr.bin/oasm/lex.c
parent6b3c37f5bc9dbd3656ee08b925f2df2d233084fe (diff)
oasm: Introduce AND mnemonic
Implement mnemonic for the AND instruction: -- and x1, #7 ! x1 = x1 & 7 -- Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/lex.c')
-rw-r--r--usr.bin/oasm/lex.c3
1 files changed, 3 insertions, 0 deletions
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;