add nop pseudo code

This commit is contained in:
Freya Murphy 2024-10-01 18:19:08 -04:00
parent 4af200b001
commit 853a1ba612
Signed by: freya
GPG key ID: 744AB800E383AE52

View file

@ -889,6 +889,17 @@ static int parse_pseudo_move(struct parser *parser, struct ins_expr *expr)
return M_SUCCESS; return M_SUCCESS;
} }
static int parse_pseudo_nop(struct parser *parser, struct ins_expr *expr)
{
(void) parser;
expr->ins_len = 1;
expr->ins[0] = mips_instructions[MIPS_INS_SLL];
expr->ref[0].type = R_MIPS_NONE;
return M_SUCCESS;
}
static int parse_pseudo_instruction(struct parser *parser, static int parse_pseudo_instruction(struct parser *parser,
struct ins_expr *expr, struct ins_expr *expr,
struct token ident) struct token ident)
@ -911,6 +922,10 @@ static int parse_pseudo_instruction(struct parser *parser,
res = parse_pseudo_la(parser, expr); res = parse_pseudo_la(parser, expr);
else CHK(move) else CHK(move)
res = parse_pseudo_move(parser, expr); res = parse_pseudo_move(parser, expr);
else CHK(nop)
res = parse_pseudo_nop(parser, expr);
#undef CHK
if (res) { if (res) {
// reset on fail // reset on fail