about summary refs log tree commit diff stats
path: root/subx/026labels.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-27 12:33:08 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-27 12:35:49 -0700
commit4718a77ce26c02bac7cfe28637c2892091ac0075 (patch)
treeea3af5905138b2cdf09c55f64ba557fd434b54e2 /subx/026labels.cc
parent7a79dafad1f458030a9e53ad2e3f84861dac7f06 (diff)
downloadmu-4718a77ce26c02bac7cfe28637c2892091ac0075.tar.gz
4444
More tracing reorg.
Diffstat (limited to 'subx/026labels.cc')
-rw-r--r--subx/026labels.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/subx/026labels.cc b/subx/026labels.cc
index fc52fe74..cc11eb0b 100644
--- a/subx/026labels.cc
+++ b/subx/026labels.cc
@@ -9,13 +9,14 @@
           # 1-3 bytes   3 bits              2 bits          3 bits        3 bits    3 bits    2 bits    2 bits      0/1/2/4 bytes   0/1/2/4 bytes
 loop:
             05                                                                                                                      0x0d0c0b0a/imm32  # add to EAX
-+translate: label 'loop' is at address 1
++transform: label 'loop' is at address 1
 
 :(before "End One-time Setup")
-Transform.push_back(replace_labels);
+Transform.push_back(rewrite_labels);
 
 :(code)
-void replace_labels(program& p) {
+void rewrite_labels(program& p) {
+  trace(99, "transform") << "-- rewrite labels" << end();
   if (p.segments.empty()) return;
   segment& code = p.segments.at(0);
   map<string, uint32_t> address;
@@ -53,7 +54,7 @@ void compute_addresses_for_labels(const segment& code, map<string, uint32_t> add
           raise << "'" << to_string(inst) << "': labels can only be the first word in a line.\n" << end();
         string label = curr.data.substr(0, SIZE(curr.data)-1);
         put(address, label, current_byte);
-        trace(99, "translate") << "label '" << label << "' is at address " << (current_byte+code.start) << end();
+        trace(99, "transform") << "label '" << label << "' is at address " << (current_byte+code.start) << end();
         // no modifying current_byte; label definitions won't be in the final binary
       }
     }
@@ -90,6 +91,6 @@ loop2:
             05                                                                                                                      0x0d0c0b0a/imm32  # add to EAX
 loop3:
             f
-+translate: label 'loop' is at address 1
-+translate: label 'loop2' is at address 1
-+translate: label 'loop3' is at address 6
++transform: label 'loop' is at address 1
++transform: label 'loop2' is at address 1
++transform: label 'loop3' is at address 6