asm: implement stub instruction emitter
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/selector.h>
|
||||
#include <ivy/asm/instr.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define HASH_SELF 0x2d19e518d40792b7
|
||||
@@ -154,8 +155,10 @@ static enum index_base get_index_base(struct ivy_asm_token *tok)
|
||||
}
|
||||
}
|
||||
|
||||
static enum ivy_status write_instruction(struct block_parser_state *state)
|
||||
static enum ivy_status write_instruction(struct ivy_asm_parser *p, struct block_parser_state *state)
|
||||
{
|
||||
struct ivy_instr instr = {0};
|
||||
ivy_assembler_put_instr(p->p_assembler, &instr);
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
@@ -234,7 +237,7 @@ static enum ivy_status push_reg_arg(
|
||||
static enum ivy_status parse_linefeed(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct block_parser_state *state
|
||||
struct block_parser_state *state
|
||||
= (struct block_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
switch (state->s_prev_component) {
|
||||
@@ -244,7 +247,7 @@ static enum ivy_status parse_linefeed(
|
||||
case INSTR_OPERAND:
|
||||
case INSTR_OPERAND_INDEX_RIGHT:
|
||||
state->s_prev_component = INSTR_NONE;
|
||||
return write_instruction(state);
|
||||
return write_instruction(ctx, state);
|
||||
default:
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user