comparison python/testasm.py @ 232:e621e3ba78d2

Added left shift instruction
author Windel Bouwman
date Sun, 14 Jul 2013 11:50:58 +0200
parents 5af52987f5bd
children 83781bd10fdb
comparison
equal deleted inserted replaced
231:521567d17388 232:e621e3ba78d2
156 def feed(self, line): 156 def feed(self, line):
157 self.a.assemble(line) 157 self.a.assemble(line)
158 158
159 def check(self, hexstr): 159 def check(self, hexstr):
160 self.assertSequenceEqual(bytes.fromhex(hexstr), self.a.binout) 160 self.assertSequenceEqual(bytes.fromhex(hexstr), self.a.binout)
161 161
162 def testMapOperand(self): 162 def testMapOperand(self):
163 pass 163 pass
164 164
165 def testMovImm8(self): 165 def testMovImm8(self):
166 self.feed('mov r4, 100') 166 self.feed('mov r4, 100')
195 self.check('0190') 195 self.check('0190')
196 196
197 def testCmpRegReg(self): 197 def testCmpRegReg(self):
198 self.feed('cmp r0, r1') 198 self.feed('cmp r0, r1')
199 self.check('8842') 199 self.check('8842')
200
201 def testLeftShit(self):
202 self.feed('lsl r3, r5')
203 self.check('ab40')
200 204
201 def testSequence1(self): 205 def testSequence1(self):
202 self.feed('mov r5, 3') 206 self.feed('mov r5, 3')
203 self.feed('add r4, r5, 0') 207 self.feed('add r4, r5, 0')
204 self.feed('loop: add r6, r4, 7') 208 self.feed('loop: add r6, r4, 7')