Mercurial > lcfOS
comparison test/testmsp430asm.py @ 346:3bb7dcfe5529
expanded arm target
author | Windel Bouwman |
---|---|
date | Fri, 07 Mar 2014 17:05:32 +0100 |
parents | 86b02c98a717 |
children | 442fb043d149 |
comparison
equal
deleted
inserted
replaced
345:b4882ff0ed06 | 346:3bb7dcfe5529 |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import unittest | 3 import unittest |
4 from ppci.asmnodes import AInstruction, ABinop, AUnop, ASymbol, ALabel, ANumber | |
5 from ppci.assembler import tokenize, Assembler | 4 from ppci.assembler import tokenize, Assembler |
6 from ppci.objectfile import ObjectFile | 5 from ppci.objectfile import ObjectFile |
7 from ppci.outstream import BinaryOutputStream | 6 from ppci.outstream import BinaryOutputStream |
8 from ppci.target import Label | |
9 from ppci.target.target_list import msp430target | 7 from ppci.target.target_list import msp430target |
10 from testasm import AsmTestCaseBase | 8 from testasm import AsmTestCaseBase |
11 | 9 |
10 a = Assembler(msp430target) | |
12 | 11 |
13 class Msp430AssemblerTestCase(AsmTestCaseBase): | 12 class Msp430AssemblerTestCase(AsmTestCaseBase): |
14 def setUp(self): | 13 def setUp(self): |
15 self.t = msp430target | 14 self.t = msp430target |
16 self.obj = ObjectFile() | 15 self.obj = ObjectFile() |
17 self.o = BinaryOutputStream(self.obj) | 16 self.ostream = BinaryOutputStream(self.obj) |
18 self.o.selectSection('.text') | 17 self.ostream.selectSection('.text') |
19 self.a = Assembler(target=self.t, stream=self.o) | 18 self.a = a |
20 | 19 |
21 def testMov(self): | 20 def testMov(self): |
22 self.feed("mov r14, r15") | 21 self.feed("mov r14, r15") |
23 self.check('0F4E') | 22 self.check('0F4E') |
24 | 23 |