当前位置: 首页>>代码示例>>Python>>正文


Python Monitor.do_mem方法代码示例

本文整理汇总了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>'))
开发者ID:McNeight,项目名称:py65,代码行数:9,代码来源:test_monitor.py

示例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>"))
开发者ID:biappi,项目名称:Swift6502,代码行数:9,代码来源:test_monitor.py

示例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)
开发者ID:McNeight,项目名称:py65,代码行数:10,代码来源:test_monitor.py

示例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)
开发者ID:biappi,项目名称:Swift6502,代码行数:10,代码来源:test_monitor.py

示例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)
开发者ID:McNeight,项目名称:py65,代码行数:12,代码来源:test_monitor.py

示例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")
开发者ID:mnaberez,项目名称:py65,代码行数:13,代码来源:test_monitor.py


注:本文中的py65.monitor.Monitor.do_mem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。