1
0
Fork 0
mirror of https://github.com/pnx/m16vm synced 2026-06-16 03:44:55 +02:00

src/as/parser.c: J-Type should now accept a label as argument.

This commit is contained in:
Henrik Hautakoski 2018-12-10 22:03:05 +01:00
parent 2b80662967
commit 7ec84ad2a1
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -108,10 +108,11 @@ static int match_typeI(struct lexer* lex, struct ast *ast) {
return 1;
}
// J-Type (rs : u8, addr : u16)
// J-Type (addr : string)
static int match_typeJ(struct lexer* lex, struct ast *ast) {
match_imm(1, ast);
if (match_operand(lex, TOKEN_LABEL, ast) < 0)
return asm_error(lex->lineno, "Expected label at argument 1");
match_end;
return 1;
}