about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-10-01 12:30:15 -0700
committerKartik Agaram <vc@akkartik.com>2018-10-01 12:30:15 -0700
commitfb7e66fd4b30cc4c0aa9abcdf64ab7e33a0e9ef3 (patch)
tree0677e9ce372bf8e91e3b6b832e28e106b6ab5529 /subx
parent2b51cba67ce8fc41fb6963637f53a836938479a8 (diff)
downloadmu-fb7e66fd4b30cc4c0aa9abcdf64ab7e33a0e9ef3.tar.gz
4640 - clear error message on missing library
Diffstat (limited to 'subx')
-rw-r--r--subx/030---operands.cc2
-rw-r--r--subx/035labels.cc3
-rw-r--r--subx/036global_variables.cc2
3 files changed, 6 insertions, 1 deletions
diff --git a/subx/030---operands.cc b/subx/030---operands.cc
index a9c85778..34953480 100644
--- a/subx/030---operands.cc
+++ b/subx/030---operands.cc
@@ -351,6 +351,7 @@ b9 0x080490a7/imm32  # copy to ECX
 
 :(scenarios transform)
 :(scenario pack_silently_ignores_non_hex)
+% Hide_errors = true;
 == 0x1
 # instruction                     effective address                                                   operand     displacement    immediate
 # op          subop               mod             rm32          base        index         scale       r32
@@ -359,7 +360,6 @@ b9 0x080490a7/imm32  # copy to ECX
 +transform: packing instruction 'bb foo/imm32'
 # no change (we're just not printing metadata to the trace)
 +transform: instruction after packing: 'bb foo'
-$error: 0
 :(scenarios run)
 
 :(scenario pack_flags_bad_hex)
diff --git a/subx/035labels.cc b/subx/035labels.cc
index 75000233..c2965b2c 100644
--- a/subx/035labels.cc
+++ b/subx/035labels.cc
@@ -24,6 +24,7 @@ if (SIZE(s) == 2) return true;
 
 :(scenarios transform)
 :(scenario pack_immediate_ignores_single_byte_nondigit_operand)
+% Hide_errors = true;
 == 0x1
 b9/copy a/imm32  # copy to ECX
 +transform: packing instruction 'b9/copy a/imm32'
@@ -31,6 +32,7 @@ b9/copy a/imm32  # copy to ECX
 +transform: instruction after packing: 'b9 a'
 
 :(scenario pack_immediate_ignores_3_hex_digit_operand)
+% Hide_errors = true;
 == 0x1
 b9/copy aaa/imm32  # copy to ECX
 +transform: packing instruction 'b9/copy aaa/imm32'
@@ -38,6 +40,7 @@ b9/copy aaa/imm32  # copy to ECX
 +transform: instruction after packing: 'b9 aaa'
 
 :(scenario pack_immediate_ignores_non_hex_operand)
+% Hide_errors = true;
 == 0x1
 b9/copy xxx/imm32  # copy to ECX
 +transform: packing instruction 'b9/copy xxx/imm32'
diff --git a/subx/036global_variables.cc b/subx/036global_variables.cc
index f278ee29..e34c5b73 100644
--- a/subx/036global_variables.cc
+++ b/subx/036global_variables.cc
@@ -69,6 +69,8 @@ void replace_global_variables_with_addresses(program& p, const map<string, uint3
     for (int j = 0;  j < SIZE(inst.words);  ++j) {
       const word& curr = inst.words.at(j);
       if (!contains_key(address, curr.data)) {
+        if (!looks_like_hex_int(curr.data))
+          raise << "missing reference to global '" << curr.data << "'\n" << end();
         new_inst.words.push_back(curr);
         continue;
       }