about summary refs log tree commit diff stats
path: root/subx/035labels.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-20 13:42:57 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-20 13:42:57 -0700
commit87d5bdb96193be044cc95f562904fc6da60e0bf0 (patch)
treebd8669e7f77ce53e66f72dfdc405b24dd92d1f1b /subx/035labels.cc
parent220575dc4a70228438ed6f4a10324f5669277044 (diff)
downloadmu-87d5bdb96193be044cc95f562904fc6da60e0bf0.tar.gz
4550
Diffstat (limited to 'subx/035labels.cc')
-rw-r--r--subx/035labels.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/subx/035labels.cc b/subx/035labels.cc
index df54bf2f..6edae0d9 100644
--- a/subx/035labels.cc
+++ b/subx/035labels.cc
@@ -216,3 +216,20 @@ xz:
  -a:  # indent to avoid looking like a trace_should_not_contain command for this scenario
             05                                                                                                                              0x0d0c0b0a/imm32  # add to EAX
 +error: '-a' starts with '-', which can be confused with a negative number; use a different name
+
+//: now that we have labels, we need to adjust segment size computation to
+//: ignore them.
+
+:(scenario segment_size_ignores_labels)
+% Mem_offset = CODE_START;
+== code  # 0x08048074
+05/add 0x0d0c0b0a/imm32  # 5 bytes
+foo:                     # 0 bytes
+== data  # 0x08049079
+bar:
+00
++transform: segment 1 begins at address 0x08049079
+
+:(before "End num_bytes(curr) Special-cases")
+else if (is_label(curr))
+  ;  // don't count it