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


Python AddressParser.labels方法代码示例

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


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

示例1: test_number_label_dec_offset

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_label_dec_offset(self):
   parser = AddressParser()
   parser.labels = {'foo': 0xC000}
   self.assertEquals(0xC003, parser.number('foo++3'))
   self.assertEquals(0xBFFD, parser.number('foo-+3'))
   self.assertEquals(0xC003, parser.number('foo + +3'))
   self.assertEquals(0xBFFD, parser.number('foo - +3'))
开发者ID:ddribin,项目名称:py65,代码行数:9,代码来源:test_addressing.py

示例2: test_number_label_bin_offset

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_label_bin_offset(self):
   parser = AddressParser()
   parser.labels = {'foo': 0xC000}
   self.assertEqual(0xC003, parser.number('foo+%00000011'))
   self.assertEqual(0xBFFD, parser.number('foo-%00000011'))
   self.assertEqual(0xC003, parser.number('foo + %00000011'))
   self.assertEqual(0xBFFD, parser.number('foo - %00000011'))
开发者ID:dabeaz,项目名称:py65,代码行数:9,代码来源:test_addressing.py

示例3: test_number_label_dec_offset

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_label_dec_offset(self):
     parser = AddressParser()
     parser.labels = {"foo": 0xC000}
     self.assertEqual(0xC003, parser.number("foo++3"))
     self.assertEqual(0xBFFD, parser.number("foo-+3"))
     self.assertEqual(0xC003, parser.number("foo + +3"))
     self.assertEqual(0xBFFD, parser.number("foo - +3"))
开发者ID:BigEd,项目名称:py65,代码行数:9,代码来源:test_addressing.py

示例4: test_number_bad_label_syntax

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_bad_label_syntax(self):
     parser = AddressParser()
     parser.labels = {'foo': 0xFFFF}
     try:
         parser.number('#$foo')
         self.fail()
     except KeyError as exc:
         self.assertEqual('Label not found: #$foo', exc.args[0])
开发者ID:B-Rich,项目名称:py65,代码行数:10,代码来源:test_addressing.py

示例5: test_number_label_offset_default_radix

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_label_offset_default_radix(self):
   parser = AddressParser()
   parser.labels = {'foo': 0xC000}
   parser.radix = 16
   self.assertEqual(0xC010, parser.number('foo+10'))
   self.assertEqual(0xBFF0, parser.number('foo-10'))
   self.assertEqual(0xC010, parser.number('foo + 10'))
   self.assertEqual(0xBFF0, parser.number('foo - 10'))    
   parser.radix = 10
   self.assertEqual(0xC00A, parser.number('foo+10'))
   self.assertEqual(0xBFF6, parser.number('foo-10'))
   self.assertEqual(0xC00A, parser.number('foo + 10'))
   self.assertEqual(0xBFF6, parser.number('foo - 10'))    
开发者ID:dabeaz,项目名称:py65,代码行数:15,代码来源:test_addressing.py

示例6: test_number_truncates_address_at_maxwidth_16

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_truncates_address_at_maxwidth_16(self):
   parser = AddressParser()
   parser.labels = {'foo': 0xFFFF}
   self.assertEqual(0xFFFF, parser.number('foo+5'))
开发者ID:dabeaz,项目名称:py65,代码行数:6,代码来源:test_addressing.py

示例7: test_number_label

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_label(self):
   parser = AddressParser()
   parser.labels = {'foo': 0xC000}
   self.assertEqual(0xC000, parser.number('foo'))
开发者ID:dabeaz,项目名称:py65,代码行数:6,代码来源:test_addressing.py

示例8: test_number_constrains_address_at_maxwidth_24

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_constrains_address_at_maxwidth_24(self):
     parser = AddressParser()
     parser.maxwidth = 24
     parser.labels = {'foo': 0xFFFFFF}
     self.assertRaises(OverflowError, parser.number, 'foo+5')
开发者ID:B-Rich,项目名称:py65,代码行数:7,代码来源:test_addressing.py

示例9: test_number_truncates_address_at_maxwidth_24

# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import labels [as 别名]
 def test_number_truncates_address_at_maxwidth_24(self):
     parser = AddressParser()
     parser.maxwidth = 24
     parser.labels = {"foo": 0xFFFFFF}
     self.assertEqual(0xFFFFFF, parser.number("foo+5"))
开发者ID:BigEd,项目名称:py65,代码行数:7,代码来源:test_addressing.py


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