about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-21 12:37:33 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-21 12:37:33 -0700
commit0828df68de1defe68d63fd19cd3ed76be09918c8 (patch)
tree6b97a0a0b09777f8c26987c5fad1fee5b696d433 /subx
parent8998908e63c1231ac8b83232623ab8c6d77fe9d1 (diff)
downloadmu-0828df68de1defe68d63fd19cd3ed76be09918c8.tar.gz
4566
Neither jump nor call instructions support immediates. Drop that.
The only form of absolute addressing relies on rm32.
Diffstat (limited to 'subx')
-rw-r--r--subx/035labels.cc4
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);
         }
       }