Added 'use_origin' flag to let disassembler know that it has a real origin in memory so that labels are meaningful

This commit is contained in:
Rob McMullen 2017-03-20 23:25:52 -07:00
parent e7f0b49c34
commit 491589d686
2 changed files with 6 additions and 1 deletions

View File

@ -578,7 +578,7 @@ class Dos33DiskImage(DiskImageBase):
addr = dirent.get_binary_start_address(self) - 4 # factor in 4 byte header
else:
addr = 0
segment = DefaultSegment(raw, start_addr=addr, name=name, verbose_name=verbose_name)
segment = ObjSegment(raw, 0, 0, start_addr=addr, name=name, verbose_name=verbose_name)
if addr > 0:
style = segment.get_style_bits(data=True)
segment.style[0:4] = style

View File

@ -312,6 +312,10 @@ class DefaultSegment(object):
self.map_width = 40
self.uuid = str(uuid.uuid4())
# Some segments may not have a standard place in memory, so this flag
# can be used to skip the memory map lookup when displaying disassembly
self.use_origin = False
def set_raw(self, rawdata):
self.rawdata = rawdata
self.data = rawdata.get_data()
@ -895,6 +899,7 @@ class ObjSegment(DefaultSegment):
DefaultSegment.__init__(self, rawdata, start_addr, name, **kwargs)
self.metadata_start = metadata_start
self.data_start = data_start
self.use_origin = True
def __str__(self):
count = len(self)