本文整理汇总了Python中py65.monitor.Monitor.do_registers方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.do_registers方法的具体用法?Python Monitor.do_registers怎么用?Python Monitor.do_registers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py65.monitor.Monitor
的用法示例。
在下文中一共展示了Monitor.do_registers方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_registers_updates_single_register
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_updates_single_register(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('x=42')
out = stdout.getvalue()
self.assertEqual("", out)
self.assertEqual(0x42, mon._mpu.x)
示例2: test_registers_a_overflow
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_a_overflow(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('a=100')
out = stdout.getvalue()
expected = "Overflow: '100' too wide for register 'a'"
self.assertTrue(out.startswith(expected))
示例3: test_registers_updates_all_registers
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_updates_all_registers(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('a=42,x=43,y=44,p=45, sp=46, pc=4600')
out = stdout.getvalue()
self.assertEqual("", out)
self.assertEqual(0x42, mon._mpu.a)
self.assertEqual(0x43, mon._mpu.x)
self.assertEqual(0x44, mon._mpu.y)
self.assertEqual(0x45, mon._mpu.p)
self.assertEqual(0x46, mon._mpu.sp)
self.assertEqual(0x4600, mon._mpu.pc)
示例4: test_registers_invalid_register_error
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_invalid_register_error(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('z=3')
out = stdout.getvalue()
self.assertEqual("Invalid register: z\n", out)
示例5: test_registers_label_error_bad_value
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_label_error_bad_value(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('x=pony')
out = stdout.getvalue()
self.assertEqual("Label not found: pony\n", out)
示例6: test_registers_syntax_error_bad_format
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_syntax_error_bad_format(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('x')
out = stdout.getvalue()
self.assertEqual("Syntax error: x\n", out)
示例7: test_registers_display_returns_to_prompt
# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import do_registers [as 别名]
def test_registers_display_returns_to_prompt(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_registers('')
out = stdout.getvalue()
self.assertEqual('', out)