diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-21 09:17:30 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-21 09:17:30 -0400 |
commit | 3ab5f07bac34bc9de5b9038407353c707f3f4c2f (patch) | |
tree | 57b028642f4fc81d839994132eda2859d6255162 /usr.bin/oasm/lex.c | |
parent | 60c8f4c34194fcec0e9e7d8da9cd1ad8b38707e7 (diff) |
oasm: Parse and encode the "HLT" instruction
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/lex.c')
-rw-r--r-- | usr.bin/oasm/lex.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |