summaryrefslogtreecommitdiff
path: root/usr.bin/oasm/lex.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-22 02:34:25 -0400
committerIan Moffett <ian@osmora.org>2025-07-22 02:34:25 -0400
commitea521725a7739ec568eb6961edabf71d8169ef9e (patch)
tree22a61a45448455d16c8c5196bb6cc4101edc9a10 /usr.bin/oasm/lex.c
parentc774776241f7b20ae40b432c11d0d161b75d2e79 (diff)
oasm: Introduce encoding for MUL instruction
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 b3af2b1..7b78d54 100644
--- a/usr.bin/oasm/lex.c
+++ b/usr.bin/oasm/lex.c
@@ -42,6 +42,7 @@ static char putback = '\0';
#define S_IMN_MOV "mov"
#define S_IMN_ADD "add"
#define S_IMN_SUB "sub"
+#define S_IMN_MUL "mul"
#define S_IMN_DIV "div"
#define S_IMN_INC "inc"
#define S_IMN_DEC "dec"
@@ -182,6 +183,8 @@ token_arith(char *p)
return TT_DIV;
} else if (strcmp(p, S_IMN_HLT) == 0) {
return TT_HLT;
+ } else if (strcmp(p, S_IMN_MUL) == 0) {
+ return TT_MUL;
}
return TT_UNKNOWN;