Mercurial > lcfOS
comparison test/testmsp430asm.py @ 381:6df89163e114
Fix section and ldr pseudo instruction
author | Windel Bouwman |
---|---|
date | Sat, 26 Apr 2014 17:41:56 +0200 |
parents | 442fb043d149 |
children | 173e20a47fda |
comparison
equal
deleted
inserted
replaced
380:67a584582aee | 381:6df89163e114 |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import unittest | 3 import unittest |
4 from ppci.assembler import tokenize, Assembler | |
5 from ppci.objectfile import ObjectFile | 4 from ppci.objectfile import ObjectFile |
6 from ppci.outstream import BinaryOutputStream | 5 from ppci.outstream import BinaryOutputStream |
7 from ppci.target.target_list import msp430target | 6 from ppci.target.target_list import msp430target |
8 from testasm import AsmTestCaseBase | 7 from testasm import AsmTestCaseBase |
9 | 8 |
10 a = Assembler(msp430target) | |
11 | 9 |
12 class Msp430AssemblerTestCase(AsmTestCaseBase): | 10 class Msp430AssemblerTestCase(AsmTestCaseBase): |
13 def setUp(self): | 11 def setUp(self): |
14 self.t = msp430target | 12 self.t = msp430target |
15 self.obj = ObjectFile() | 13 self.obj = ObjectFile() |
16 self.ostream = BinaryOutputStream(self.obj) | 14 self.ostream = BinaryOutputStream(self.obj) |
17 self.ostream.select_section('.text') | 15 self.ostream.select_section('.text') |
18 self.a = a | 16 self.assembler = msp430target.assembler |
19 | 17 |
20 def testMov(self): | 18 def testMov(self): |
21 self.feed("mov r14, r15") | 19 self.feed("mov r14, r15") |
22 self.check('0F4E') | 20 self.check('0F4E') |
23 | 21 |