示例#1
0
文件: testas.py 项目: ghewgill/pycc
 def test_add(self):
     pyas.assemble_instruction("org $800")
     pyas.assemble_instruction("foo: dat 2")
     pyas.assemble_instruction("bar: dat 2")
     self.assertEqual(pyas.symbols.get("foo"), 0x800)
     self.assertEqual(pyas.symbols.get("bar"), 0x802)
示例#2
0
文件: testas.py 项目: ghewgill/pycc
 def test_set(self):
     pyas.assemble_instruction("set five = 5")
     self.assertEqual(pyas.symbols.get("five"), 5)
示例#3
0
文件: testas.py 项目: ghewgill/pycc
def asm(s):
    return pyas.assemble_instruction(s).bytes()