本文整理汇总了Python中py65.utils.addressing.AddressParser.range方法的典型用法代码示例。如果您正苦于以下问题:Python AddressParser.range方法的具体用法?Python AddressParser.range怎么用?Python AddressParser.range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py65.utils.addressing.AddressParser
的用法示例。
在下文中一共展示了AddressParser.range方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_range_mixed
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import range [as 别名]
def test_range_mixed(self):
parser = AddressParser(labels={'chrout':0xFFD2})
self.assertEqual((0xFFD2, 0xFFD4), parser.range('chrout:ffd4'))
示例2: test_range_start_exceeds_end
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import range [as 别名]
def test_range_start_exceeds_end(self):
parser = AddressParser(labels={})
self.assertEqual((0xFFD2, 0xFFD4), parser.range('ffd4:ffd2'))
示例3: test_range_two_numbers
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import range [as 别名]
def test_range_two_numbers(self):
parser = AddressParser(labels={})
self.assertEqual((0xFFD2, 0xFFD4), parser.range('ffd2:ffd4'))
示例4: test_range_one_label
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import range [as 别名]
def test_range_one_label(self):
parser = AddressParser(labels={'chrout':0xFFD2})
self.assertEqual((0xFFD2, 0xFFD2), parser.range('chrout'))
示例5: test_range_one_number
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import range [as 别名]
def test_range_one_number(self):
parser = AddressParser(labels={})
self.assertEqual((0xFFD2, 0xFFD2), parser.range('ffd2'))
示例6: Monitor
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import range [as 别名]
#.........这里部分代码省略.........
start = self._address_parser.number(args)
except KeyError:
self._output("Bad label: %s" % start)
return
assembling = True
while assembling:
prompt = "\r$%04x " % (start)
line = console.line_input(prompt,
stdin=self.stdin, stdout=self.stdout)
if not line:
self.stdout.write("\n")
return
# assemble into memory
bytes = self._assembler.assemble(line)
if bytes is None:
self.stdout.write("\r$%04x ???\n" % start)
continue
end = start + len(bytes)
self._mpu.memory[start:end] = bytes
# print disassembly
bytes, disasm = self._disassembler.instruction_at(start)
disassembly = self._format_disassembly(start, bytes, disasm)
self.stdout.write("\r" + (' ' * (len(prompt+line) + 5) ) + "\r")
self.stdout.write(disassembly + "\n")
start += bytes
def do_disassemble(self, args):
start, end = self._address_parser.range(args)
if start == end:
end += 1
address = start
while address < end:
bytes, disasm = self._disassembler.instruction_at(address)
self._output(self._format_disassembly(address, bytes, disasm))
address += bytes
def _format_disassembly(self, address, bytes, disasm):
mem = ''
for byte in self._mpu.memory[address:address+bytes]:
mem += '%02x ' % byte
return "$%04x %-10s%s" % (address, mem, disasm)
def help_disassemble(self):
self._output("disassemble <address_range>")
self._output("Disassemble instructions in the address range.")
def help_step(self):
self._output("step")
self._output("Single-step through instructions.")
def do_step(self, args):
self._mpu.step()
self.do_disassemble('%04x' % self._mpu.pc)
def help_return(self):
self._output("return")
self._output("Continues execution and returns to the monitor just")
self._output("before the next RTS or RTI is executed.")