diff options
Diffstat (limited to 'usr.bin/oasm/parse.c')
-rw-r--r-- | usr.bin/oasm/parse.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c index 7a855ca..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", @@ -107,6 +108,7 @@ parse_reg(struct oasm_state *state, struct oasm_token *tok) case TT_MOV: case TT_DEC: case TT_INC: + case TT_ADD: state->last = tok->type; break; default: @@ -139,10 +141,17 @@ 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); break; + case TT_ADD: + state->last = tok->type; + emit_osxm64(&emit_state, tok); + break; case TT_DEC: case TT_INC: state->last = tok->type; |