Skip to content

Commit 6d0e826

Browse files
fix hexinfo script: incorrect CS:IP math (issue #59); small error in dump.
1 parent 2fd8f41 commit 6d0e826

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

intelhex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ def dump(self, tofile=None, width=16, withpadding=False):
812812
elif eip is None and cs is not None and ip is not None:
813813
tofile.write('CS = 0x%04X, IP = 0x%04X\n' % (cs, ip))
814814
else:
815-
tofile.write('start_addr = %r\n' % start_addr)
815+
tofile.write('start_addr = %r\n' % self.start_addr)
816816
# actual data
817817
addresses = dict_keys(self._buf)
818818
if addresses:

intelhex/scripts/hexinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def summarize_yaml(fname):
6161
if ih.start_addr:
6262
keys = sorted(ih.start_addr.keys())
6363
if keys == ['CS','IP']:
64-
entry = ih.start_addr['CS'] * 65536 + ih.start_addr['IP']
64+
entry = ih.start_addr['CS'] * 16 + ih.start_addr['IP']
6565
elif keys == ['EIP']:
6666
entry = ih.start_addr['EIP']
6767
else:

0 commit comments

Comments
 (0)