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


Python Monitor.do_fill方法代码示例

本文整理汇总了Python中py65.monitor.Monitor.do_fill方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.do_fill方法的具体用法?Python Monitor.do_fill怎么用?Python Monitor.do_fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在py65.monitor.Monitor的用法示例。


在下文中一共展示了Monitor.do_fill方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_do_fill_with_no_args_shows_help

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_fill [as 别名]
    def test_do_fill_with_no_args_shows_help(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_fill('')

        out = stdout.getvalue()
        self.assertTrue(out.startswith('fill <address_range>'))
开发者ID:McNeight,项目名称:py65,代码行数:9,代码来源:test_monitor.py

示例2: test_do_fill_bad_label_in_value_shows_error

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_fill [as 别名]
    def test_do_fill_bad_label_in_value_shows_error(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_fill('0 nonexistent')

        out = stdout.getvalue()
        self.assertTrue(out.startswith("Label not found: nonexistent"))
开发者ID:mnaberez,项目名称:py65,代码行数:9,代码来源:test_monitor.py

示例3: test_do_fill_will_fill_one_address

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_fill [as 别名]
    def test_do_fill_will_fill_one_address(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon._mpu.memory[0xc000] = 0x00
        mon.do_fill('c000 aa')

        self.assertEqual(0xAA, mon._mpu.memory[0xc000])
        out = stdout.getvalue()
        self.assertTrue(out.startswith('Wrote +1 bytes from $c000 to $c000'))
开发者ID:McNeight,项目名称:py65,代码行数:11,代码来源:test_monitor.py

示例4: test_external_memory

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_fill [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

示例5: test_do_fill_will_fill_an_address_range_with_a_single_byte

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_fill [as 别名]
    def test_do_fill_will_fill_an_address_range_with_a_single_byte(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon._mpu.memory[0xc000] = 0x00
        mon._mpu.memory[0xc001] = 0x00
        mon._mpu.memory[0xc002] = 0x00
        mon.do_fill('c000:c001 aa')

        self.assertEqual(0xAA, mon._mpu.memory[0xc000])
        self.assertEqual(0xAA, mon._mpu.memory[0xc001])
        self.assertEqual(0x00, mon._mpu.memory[0xc002])
        out = stdout.getvalue()
        self.assertTrue(out.startswith('Wrote +2 bytes from $c000 to $c001'))
开发者ID:McNeight,项目名称:py65,代码行数:15,代码来源:test_monitor.py

示例6: test_do_fill_will_fill_an_address_range_with_byte_sequence

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_fill [as 别名]
    def test_do_fill_will_fill_an_address_range_with_byte_sequence(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon._mpu.memory[0xc000] = 0x00
        mon._mpu.memory[0xc001] = 0x00
        mon._mpu.memory[0xc002] = 0x00
        mon._mpu.memory[0xc003] = 0x00
        mon.do_fill('c000:c003 aa bb')

        self.assertEqual(0xAA, mon._mpu.memory[0xc000])
        self.assertEqual(0xBB, mon._mpu.memory[0xc001])
        self.assertEqual(0xAA, mon._mpu.memory[0xc002])
        self.assertEqual(0xBB, mon._mpu.memory[0xc003])
        out = stdout.getvalue()
        self.assertTrue(out.startswith('Wrote +4 bytes from $c000 to $c003'))
开发者ID:McNeight,项目名称:py65,代码行数:17,代码来源:test_monitor.py


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