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/parse.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/parse.c')
-rw-r--r-- | usr.bin/oasm/parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |