本文整理汇总了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>'))
示例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"))
示例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'))
示例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")
示例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'))
示例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'))