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/parse.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'usr.bin/oasm/parse.c') diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c index f87f903..6851935 100644 --- a/usr.bin/oasm/parse.c +++ b/usr.bin/oasm/parse.c @@ -42,6 +42,7 @@ static const char *tokstr[] = { [ TT_SUB ] = "sub", [ TT_MUL ] = "mul", [ TT_DIV ] = "div", + [ TT_HLT ] = "hlt", [ TT_COMMA ] = ",", [ TT_INC ] = "inc", [ TT_DEC ] = "dec", @@ -140,6 +141,9 @@ parse_tok(struct oasm_state *state, struct oasm_token *tok) int error; switch (tok->type) { + case TT_HLT: + state->last = tok->type; + emit_osxm64(&emit_state, tok); case TT_MOV: state->last = tok->type; emit_osxm64(&emit_state, tok); -- cgit v1.2.3