mirror of
https://github.com/pnx/m16vm
synced 2026-06-17 03:50:03 +02:00
src/as/parser.c: J-Type should now accept a label as argument.
This commit is contained in:
parent
2b80662967
commit
7ec84ad2a1
1 changed files with 3 additions and 2 deletions
|
|
@ -108,10 +108,11 @@ static int match_typeI(struct lexer* lex, struct ast *ast) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// J-Type (rs : u8, addr : u16)
|
// J-Type (addr : string)
|
||||||
static int match_typeJ(struct lexer* lex, struct ast *ast) {
|
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;
|
match_end;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue