예제 #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()