comparison python/testasm.py @ 276:56d37ed4b4d2

phaa
author Windel Bouwman
date Mon, 16 Sep 2013 21:51:17 +0200
parents 6f2423df0675
children 046017431c6a
comparison
equal deleted inserted replaced
275:6f2423df0675 276:56d37ed4b4d2
259 259
260 def testCmpRegReg(self): 260 def testCmpRegReg(self):
261 self.feed('cmp r0, r1') 261 self.feed('cmp r0, r1')
262 self.check('8842') 262 self.check('8842')
263 263
264 def testLeftShit(self): 264 def testAddimm3(self):
265 self.feed('add r3, r5, 2')
266 self.feed('add r4, r1, 6')
267 self.check('ab1c8c1d')
268
269 def testSubImm3(self):
270 self.feed('sub r3, r5, 2')
271 self.feed('sub r4, r1, 6')
272 self.check('ab1e8c1f')
273
274 def testLeftShift(self):
265 self.feed('lsl r3, r5') 275 self.feed('lsl r3, r5')
266 self.check('ab40') 276 self.check('ab40')
267 277
268 def testModSp(self): 278 def testAddSp(self):
269 self.feed('add sp,sp,8') 279 self.feed('add sp,sp,8')
270 self.feed('add sp,sp,16') 280 self.feed('add sp,sp,16')
281 self.check('02b004b0')
282
283 def testSubSp(self):
271 self.feed('sub sp,sp,32') 284 self.feed('sub sp,sp,32')
272 self.feed('sub sp,sp,4') 285 self.feed('sub sp,sp,4')
273 self.check('02b004b0 88b081b0') 286 self.check('88b081b0')
274 287
275 def testSequence1(self): 288 def testSequence1(self):
276 self.feed('mov r5, 3') 289 self.feed('mov r5, 3')
277 self.feed('add r4, r5, 0') 290 self.feed('add r4, r5, 0')
278 self.feed('loop: add r6, r4, 7') 291 self.feed('loop: add r6, r4, 7')