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)
def test_set(self): pyas.assemble_instruction("set five = 5") self.assertEqual(pyas.symbols.get("five"), 5)
def asm(s): return pyas.assemble_instruction(s).bytes()