Пример #1
0
 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
 def test_set(self):
     pyas.assemble_instruction("set five = 5")
     self.assertEqual(pyas.symbols.get("five"), 5)
Пример #3
0
def asm(s):
    return pyas.assemble_instruction(s).bytes()