1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Removed debug, improved 'dumpmem' file format

This commit is contained in:
Ross Wilson
2016-02-29 15:42:09 +07:00
parent 115bff6c90
commit ee9660384e

View File

@@ -422,6 +422,7 @@ class TestCPU(object):
# get address limits
if addresses is None:
# dump everything
begin = 0
end = 0x3fff
else:
@@ -440,7 +441,10 @@ class TestCPU(object):
# create dict containing memory contents: {addr: contents, ...}
mem = {}
for addr in range(begin, end+1):
mem[addr] = self.memory.fetch(addr, False)
addr_str = '%06o' % addr
value = self.memory.fetch(addr, False)
value_str = '%06o' % value
mem[addr_str] = value_str
# dump to JSON file
with open(filename, 'wb') as handle:
@@ -628,7 +632,6 @@ class TestCPU(object):
print(test)
print('\t' + '\n\t'.join(result))
self.memdump('core.txt', 03700, 0100)
def memdump(self, filename, start, number):
"""Dump memory from 'start' into 'filename', 'number' words dumped."""