diff options
-rw-r--r-- | subx/035labels.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subx/035labels.cc b/subx/035labels.cc index 6edae0d9..fc2ccd8c 100644 --- a/subx/035labels.cc +++ b/subx/035labels.cc @@ -119,7 +119,7 @@ void replace_labels_with_displacements(segment& code, const map<string, int32_t> const word& curr = inst.words.at(j); if (contains_key(byte_index, curr.data)) { int32_t displacement = static_cast<int32_t>(get(byte_index, curr.data)) - byte_index_next_instruction_starts_at; - if (has_operand_metadata(curr, "disp8") || has_operand_metadata(curr, "imm8")) { + if (has_operand_metadata(curr, "disp8")) { if (displacement > 0xff || displacement < -0x7f) raise << "'" << to_string(inst) << "': label too far away for displacement " << std::hex << displacement << " to fit in 8 bits\n" << end(); else @@ -131,7 +131,7 @@ void replace_labels_with_displacements(segment& code, const map<string, int32_t> else emit_hex_bytes(new_inst, displacement, 2); } - else if (has_operand_metadata(curr, "disp32") || has_operand_metadata(curr, "imm32")) { + else if (has_operand_metadata(curr, "disp32")) { emit_hex_bytes(new_inst, displacement, 4); } } |