annotate python/target/armregisters.py @ 340:c7cc54c0dfdf devel

Test featurebranch
author Windel Bouwman
date Sun, 23 Feb 2014 16:24:01 +0100
parents
children 4d204f6f7d4e
rev   line source
340
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
1
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
2 from .basetarget import Register
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
3
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
4 class ArmRegister(Register):
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
5 def __init__(self, num, name):
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
6 super().__init__(name)
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
7 self.num = num
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
8
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
9 def __repr__(self):
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
10 return self.name
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
11
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
12
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
13 class Reg8Op(ArmRegister):
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
14 pass
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
15
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
16
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
17 class Reg16Op(ArmRegister):
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
18 pass
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
19
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
20
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
21 R0 = Reg8Op(0, 'r0')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
22 R1 = Reg8Op(1, 'r1')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
23 R2 = Reg8Op(2, 'r2')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
24 R3 = Reg8Op(3, 'r3')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
25 R4 = Reg8Op(4, 'r4')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
26 R5 = Reg8Op(5, 'r5')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
27 R6 = Reg8Op(6, 'r6')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
28 R7 = Reg8Op(7, 'r7')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
29 R7 = Reg8Op(8, 'r8')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
30 R7 = Reg8Op(9, 'r9')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
31 R7 = Reg8Op(10, 'r10')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
32 R7 = Reg8Op(11, 'r11')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
33 R7 = Reg8Op(12, 'r12')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
34
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
35 # Other registers:
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
36 # TODO
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
37 SP = ArmRegister(13, 'sp')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
38 LR = ArmRegister(14, 'lr')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
39 PC = ArmRegister(15, 'pc')
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
40
c7cc54c0dfdf Test featurebranch
Windel Bouwman
parents:
diff changeset
41 registers = [R0, R1, R2, R3, R4, R5, R6, R7, SP, LR, PC]