diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-27 11:10:18 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-27 11:10:18 -0700 |
commit | 7c22499166a6a1c8cd43b23f360ff4942d435178 (patch) | |
tree | e98624a961aba22f8f0f455b058ea49b8be96309 | |
parent | d1bbbc9a9bc0509bd2a6f763d6ad9a9185585de0 (diff) | |
download | mu-7c22499166a6a1c8cd43b23f360ff4942d435178.tar.gz |
4441
-rw-r--r-- | subx/026labels.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/subx/026labels.cc b/subx/026labels.cc index bc6a5009..97d5429d 100644 --- a/subx/026labels.cc +++ b/subx/026labels.cc @@ -1,6 +1,5 @@ //: Labels are defined by ending names with a ':'. This layer will compute -//: addresses for labels, and compute the offset to in jump instructions using -//: them. +//: addresses for labels, and compute the offset for instructions using them. :(scenarios transform) :(scenario map_label) @@ -13,10 +12,10 @@ loop: +label: label 'loop' is at address 1 :(before "End One-time Setup") -Transform.push_back(replace_labels_with_addresses); +Transform.push_back(replace_labels); :(code) -void replace_labels_with_addresses(program& p) { +void replace_labels(program& p) { if (p.segments.empty()) return; segment& code = p.segments.at(0); map<string, uint32_t> address; @@ -90,6 +89,7 @@ loop: loop2: 05 0x0d0c0b0a/imm32 # add to EAX loop3: + f +label: label 'loop' is at address 1 +label: label 'loop2' is at address 1 +label: label 'loop3' is at address 6 |