diff options
Diffstat (limited to 'assemble.c')
-rw-r--r-- | assemble.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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. |