Mercurial > lcfOS
comparison python/ppci/target/arm/__init__.py @ 364:c49459768aaa
Work on globals
author | Windel Bouwman |
---|---|
date | Wed, 19 Mar 2014 20:24:03 +0100 |
parents | c05ab629976a |
children | 19eacf4f7270 |
comparison
equal
deleted
inserted
replaced
363:396e5cefba13 | 364:c49459768aaa |
---|---|
1 | 1 |
2 from ..basetarget import Target | 2 from ..basetarget import Target, Label |
3 from ..arm.registers import R0, R1, R2, R3, R4, R5, R6, R7 | 3 from ..arm.registers import R0, R1, R2, R3, R4, R5, R6, R7 |
4 from ..arm.registers import R8, R9, R10, R11, R12, SP, LR, PC | 4 from ..arm.registers import R8, R9, R10, R11, R12, SP, LR, PC |
5 from ..arm.registers import register_range | 5 from ..arm.registers import register_range |
6 | 6 |
7 from .instructions import Dcd, Mov, Mov1, Add, Add2, Sub, Orr1, Mul, Mov2, Add1, Mul1 | 7 from .instructions import Dcd, Mov, Mov1, Add, Add2, Sub, Orr1, Mul, Mov2, Add1, Mul1 |
30 self.add_lowering(Sub1, lambda im: Sub1(im.dst[0], im.src[0], im.src[1])) | 30 self.add_lowering(Sub1, lambda im: Sub1(im.dst[0], im.src[0], im.src[1])) |
31 self.add_lowering(Mul1, lambda im: Mul1(im.dst[0], im.src[0], im.src[1])) | 31 self.add_lowering(Mul1, lambda im: Mul1(im.dst[0], im.src[0], im.src[1])) |
32 self.add_lowering(Lsr1, lambda im: Lsr1(im.dst[0], im.src[0], im.src[1])) | 32 self.add_lowering(Lsr1, lambda im: Lsr1(im.dst[0], im.src[0], im.src[1])) |
33 self.add_lowering(And1, lambda im: And1(im.dst[0], im.src[0], im.src[1])) | 33 self.add_lowering(And1, lambda im: And1(im.dst[0], im.src[0], im.src[1])) |
34 self.add_lowering(Mov1, lambda im: Mov1(im.dst[0], im.others[0])) | 34 self.add_lowering(Mov1, lambda im: Mov1(im.dst[0], im.others[0])) |
35 | |
36 def emit_global(self, outs, lname): | |
37 outs.emit(Label(lname)) | |
38 outs.emit(Dcd(0)) | |
35 | 39 |
36 def make_parser(self): | 40 def make_parser(self): |
37 # Assembly grammar: | 41 # Assembly grammar: |
38 self.add_keyword('r0') | 42 self.add_keyword('r0') |
39 self.add_keyword('r1') | 43 self.add_keyword('r1') |