From 04cc80c19d763f6de4ef5c3baac5026e5e6969b3 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 4 Apr 2021 12:39:34 -0400 Subject: - Fixed a bug to do with how SIB operands were parsed in the assembler. - Rewrote more of the SuB Suite to use the new calling convention. - Fixed a bug to do with SIB operands in the emulator's disassembler. - Made the MMV instruction not require a loop prefix for copying data. --- assemble.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'assemble.c') diff --git a/assemble.c b/assemble.c index 713c297..b51fd5c 100644 --- a/assemble.c +++ b/assemble.c @@ -495,6 +495,7 @@ token *get_operands(token *t, operand *op, uint64_t address, uint8_t rs, uint8_t for (; t && i < 2; t = t->next) { reg = (old_i != i) ? 0 : reg; got_value = (old_i != i) ? 0 : got_value; + is_sib = (old_i != i) ? 0 : is_sib; if (t->subtype == TOK_IND) { brack_done = (t->id == TOK_REG) ? 2 : 1; } @@ -512,7 +513,7 @@ token *get_operands(token *t, operand *op, uint64_t address, uint8_t rs, uint8_t } else { break; } - is_sib = (!stop_comma && op[i].type && op[i].id == MEM_IND); + is_sib = (!stop_comma && op[i].type && (op[i].id == MEM_IND || op[i].id == MEM_RIND)); got_value = 1; } else { if (!isvalue) { @@ -561,6 +562,7 @@ token *get_operands(token *t, operand *op, uint64_t address, uint8_t rs, uint8_t if (!is_sib) { op[i].id = (got_value) ? MEM_ZMR : op[i].id; } else if (op[i].id != MEM_SIB) { + reg = (op[i].id == MEM_IND) ? 1 : reg; op[i].type = 1; op[i].id = MEM_SIB; /* An invalid scale value was found. -- cgit v1.2.3-13-gbd6f