From 3ab5f07bac34bc9de5b9038407353c707f3f4c2f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 21 Jul 2025 09:17:30 -0400 Subject: oasm: Parse and encode the "HLT" instruction 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 f8427e0..b3af2b1 100644 --- a/usr.bin/oasm/lex.c +++ b/usr.bin/oasm/lex.c @@ -45,6 +45,7 @@ static char putback = '\0'; #define S_IMN_DIV "div" #define S_IMN_INC "inc" #define S_IMN_DEC "dec" +#define S_IMN_HLT "hlt" /* * Returns 0 if a char is counted as a @@ -179,6 +180,8 @@ token_arith(char *p) return TT_SUB; } else if (strcmp(p, S_IMN_DIV) == 0) { return TT_DIV; + } else if (strcmp(p, S_IMN_HLT) == 0) { + return TT_HLT; } return TT_UNKNOWN; -- cgit v1.2.3