Mercurial > lcfOS
comparison test/testmsp430asm.py @ 335:582a1aaa3983
Added long branch format
author | Windel Bouwman |
---|---|
date | Mon, 17 Feb 2014 20:41:30 +0100 |
parents | 6f4753202b9a |
children | 4d204f6f7d4e |
comparison
equal
deleted
inserted
replaced
334:6f4753202b9a | 335:582a1aaa3983 |
---|---|
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 | 4 from ppci.asmnodes import AInstruction, ABinop, AUnop, ASymbol, ALabel, ANumber |
5 from ppci.assembler import tokenize, Assembler | 5 from ppci.assembler import tokenize, Assembler |
6 from ppci.objectfile import ObjectFile | |
6 import outstream | 7 import outstream |
7 from target import Label | 8 from target import Label |
8 from target.target_list import msp430target | 9 from target.target_list import msp430target |
9 from testasm import AsmTestCaseBase | 10 from testasm import AsmTestCaseBase |
10 | 11 |
11 | 12 |
12 class AssemblerMSP430TestCase(AsmTestCaseBase): | 13 class AssemblerMSP430TestCase(AsmTestCaseBase): |
13 def setUp(self): | 14 def setUp(self): |
14 self.t = msp430target | 15 self.t = msp430target |
15 self.o = outstream.BinOutputStream() | 16 self.obj = ObjectFile() |
17 self.o = outstream.BinaryOutputStream(self.obj) | |
16 self.o.selectSection('.text') | 18 self.o.selectSection('.text') |
17 self.a = Assembler(target=self.t, stream=self.o) | 19 self.a = Assembler(target=self.t, stream=self.o) |
18 | 20 |
19 def testMapMovInstruction(self): | 21 def testMapMovInstruction(self): |
20 i = AInstruction('mov', [ASymbol('r14'), ASymbol('r15')]) | 22 i = AInstruction('mov', [ASymbol('r14'), ASymbol('r15')]) |