Mercurial > lcfOS
comparison python/testasm.py @ 203:ca1ea402f6a1
Added some arm instructions
author | Windel Bouwman |
---|---|
date | Sat, 15 Jun 2013 19:13:05 +0200 |
parents | f22b431f4113 |
children | 6c6bf8890d8a |
comparison
equal
deleted
inserted
replaced
202:f22b431f4113 | 203:ca1ea402f6a1 |
---|---|
162 | 162 |
163 def testYield(self): | 163 def testYield(self): |
164 self.a.assemble('yield') | 164 self.a.assemble('yield') |
165 self.assertEqual(bytes.fromhex('10bf'), self.a.binout) | 165 self.assertEqual(bytes.fromhex('10bf'), self.a.binout) |
166 | 166 |
167 def testSequence1(self): | |
168 self.a.assemble('mov r5, 3') | |
169 self.a.assemble('add r4, r5, 0') | |
170 self.a.assemble('loop: add r6, r4, 7') | |
171 self.a.assemble('cmp r6, 5') | |
172 #self.a.assemble('ble loop') | |
173 #self.assertEqual(bytes.fromhex('0325 2c1c e61d 052e fcdd'), self.a.binout) | |
174 self.assertEqual(bytes.fromhex('0325 2c1c e61d 052e'), self.a.binout) # without branch | |
175 | |
167 | 176 |
168 if __name__ == '__main__': | 177 if __name__ == '__main__': |
169 # cProfile.run('unittest.main()') | 178 #cProfile.run('unittest.main()') |
170 unittest.main() | 179 unittest.main() |
171 | 180 |