本文整理汇总了Python中py65.monitor.Monitor.do_mem方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.do_mem方法的具体用法?Python Monitor.do_mem怎么用?Python Monitor.do_mem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py65.monitor.Monitor
的用法示例。
在下文中一共展示了Monitor.do_mem方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_do_mem_shows_help_when_given_extra_args
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_mem [as 别名]
def test_do_mem_shows_help_when_given_extra_args(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_mem('c000 c001')
out = stdout.getvalue()
self.assertTrue(out.startswith('mem <address_range>'))
示例2: test_do_mem_shows_help_when_given_no_args
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_mem [as 别名]
def test_do_mem_shows_help_when_given_no_args(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_mem("")
out = stdout.getvalue()
self.assertTrue(out.startswith("mem <address_range>"))
示例3: test_do_mem_shows_memory_for_a_single_address
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_mem [as 别名]
def test_do_mem_shows_memory_for_a_single_address(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon._mpu.memory[0xC000] = 0xAA
mon.do_mem('c000')
out = stdout.getvalue()
self.assertEqual('c000: aa\n', out)
示例4: test_do_mem_wraps_at_terminal_width
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_mem [as 别名]
def test_do_mem_wraps_at_terminal_width(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon._width = 14
mon.do_mem("c000:c003")
out = stdout.getvalue()
self.assertEqual("c000: 00 00\n" "c002: 00 00\n", out)
示例5: test_do_mem_shows_memory_for_an_address_range
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_mem [as 别名]
def test_do_mem_shows_memory_for_an_address_range(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon._mpu.memory[0xC000] = 0xAA
mon._mpu.memory[0xC001] = 0xBB
mon._mpu.memory[0xC002] = 0xCC
mon.do_mem('c000:c002')
out = stdout.getvalue()
self.assertEqual('c000: aa bb cc\n', out)
示例6: test_external_memory
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_mem [as 别名]
def test_external_memory(self):
stdout = StringIO()
memory = bytearray(65536)
memory[10] = 0xff
mon = Monitor(memory=memory, stdout=stdout, putc_addr=None, getc_addr=None)
self.assertEqual(0xff, memory[10], "memory must remain untouched")
mon.do_mem('0008:000c')
mon.do_fill('0000:0020 ab')
self.assertEqual(0xab, memory[10], "memory must have been modified")
out = stdout.getvalue()
self.assertTrue(out.startswith('0008: 00 00 ff 00 00'), "monitor must see pre-initialized memory")