annotate python/ppci/target/thumb/armtarget.py @ 362:c05ab629976a

Added CPUID for arm
author Windel Bouwman
date Sat, 15 Mar 2014 10:56:34 +0100
parents 3bb7dcfe5529
children 6df89163e114
rev   line source
261
444b9df2ed99 try to split up code generation
Windel Bouwman
parents: 258
diff changeset
1 import struct
342
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
2 from ..basetarget import Register, Instruction, Target, Label, Alignment
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
3 from .instructions import Add2, Sub, Sub3, Add3, Cmp, Lsl, Orr, Add, Cmp2, Sub2, Add2, Mul, And
342
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
4 from .instructions import Dcd, Pop, Push, Yield, Mov2, Mov3
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
5 from .instructions import B, Bl, Bne, Beq, Blt, Bgt
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
6 from .instructions import Ldr, Str2, Ldr2, Str1, Ldr1, Ldr3
202
f22b431f4113 Added arm add instruction
Windel Bouwman
parents:
diff changeset
7
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
8 from .frame import ArmFrame
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents: 292
diff changeset
9 from .arminstructionselector import ArmInstructionSelector
342
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
10 from ..arm.registers import R0, R1, R2, R3, R4, R5, R6, R7, SP, LR, PC
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
11 from ..arm.registers import register_range
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
12
290
7b38782ed496 File moves
Windel Bouwman
parents: 287
diff changeset
13
7b38782ed496 File moves
Windel Bouwman
parents: 287
diff changeset
14 """ ARM target description. """
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 280
diff changeset
15
218
494828a7adf1 added some sort of cache to assembler
Windel Bouwman
parents: 216
diff changeset
16 # TODO: encode this in DSL (domain specific language)
275
6f2423df0675 Fixed serve arm-as
Windel Bouwman
parents: 268
diff changeset
17 # TBD: is this required?
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
18 # TODO: make a difference between armv7 and armv5?
219
1fa3e0050b49 Expanded ad hoc code generator
Windel Bouwman
parents: 218
diff changeset
19
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
20 thumb_assembly_rules = []
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
21 def add_rule(rhs, f):
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
22 thumb_assembly_rules.append(('instruction', rhs, f))
277
046017431c6a Started register allocator
Windel Bouwman
parents: 276
diff changeset
23
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
24
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
25 class ThumbTarget(Target):
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
26 def __init__(self):
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
27 super().__init__('thumb')
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents: 292
diff changeset
28 self.ins_sel = ArmInstructionSelector()
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents: 292
diff changeset
29 self.FrameClass = ArmFrame
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
30 self.add_rules()
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
31
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
32 # Add lowering options:
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
33 self.add_lowering(Str2, lambda im: Str2(im.src[1], im.src[0], im.others[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
34 self.add_lowering(Ldr2, lambda im: Ldr2(im.dst[0], im.src[0], im.others[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
35 self.add_lowering(Ldr3, lambda im: Ldr3(im.dst[0], im.others[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
36 self.add_lowering(Mov3, lambda im: Mov3(im.dst[0], im.others[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
37 self.add_lowering(Add2, lambda im: Add2(im.dst[0], im.src[0], im.others[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
38 self.add_lowering(Sub2, lambda im: Sub2(im.dst[0], im.src[0], im.others[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
39 self.add_lowering(Mov2, lambda im: Mov2(im.dst[0], im.src[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
40 self.add_lowering(Add3, lambda im: Add3(im.dst[0], im.src[0], im.src[1]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
41 self.add_lowering(Sub3, lambda im: Sub3(im.dst[0], im.src[0], im.src[1]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
42 self.add_lowering(Mul, lambda im: Mul(im.src[0], im.dst[0]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
43 self.add_lowering(And, lambda im: And(im.src[0], im.src[1]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
44 self.add_lowering(Orr, lambda im: Orr(im.src[0], im.src[1]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
45 self.add_lowering(Lsl, lambda im: Lsl(im.src[0], im.src[1]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
46 self.add_lowering(Cmp, lambda im: Cmp(im.src[0], im.src[1]))
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents: 345
diff changeset
47
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
48 def add_rules(self):
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
49
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
50 # Add instructions:
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
51 self.add_keyword('dcd')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
52 self.add_instruction(['dcd', 'imm32'], lambda rhs: Dcd(rhs[1]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
53
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
54 self.add_keyword('mov')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
55 self.add_instruction(['mov', 'reg8', ',', 'reg8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
56 lambda rhs: Mov2(rhs[1], rhs[3]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
57
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
58 self.add_instruction(['mov', 'reg8', ',', 'imm8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
59 lambda rhs: Mov3(rhs[1], rhs[3]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
60
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
61 self.add_keyword('add')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
62 self.add_instruction(['add', 'reg8', ',', 'reg8', ',', 'imm3'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
63 lambda rhs: Add2(rhs[1], rhs[3], rhs[5]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
64
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
65 self.add_instruction(['add', 'reg8', ',', 'reg8', ',', 'reg8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
66 lambda rhs: Add3(rhs[1], rhs[3], rhs[5]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
67
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
68 self.add_keyword('sub')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
69 self.add_instruction(['sub', 'reg8', ',', 'reg8', ',', 'imm3'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
70 lambda rhs: Sub(rhs[1], rhs[3], rhs[5]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
71
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
72 self.add_instruction(['sub', 'sp', ',', 'sp', ',', 'imm8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
73 lambda rhs: Sub(SP, SP, rhs[5]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
74
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
75 self.add_instruction(['add', 'sp', ',', 'sp', ',', 'imm8'],
342
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
76 lambda rhs: Add(SP, SP, rhs[5]))
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
77
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
78 self.add_keyword('cmp')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
79 self.add_instruction(['cmp', 'reg8', ',', 'reg8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
80 lambda rhs: Cmp(rhs[1], rhs[3]))
342
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
81 self.add_instruction(['cmp', 'reg8', ',', 'imm8'],
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
82 lambda rhs: Cmp2(rhs[1], rhs[3]))
341
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
83
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
84 self.add_keyword('lsl')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
85 self.add_instruction(['lsl', 'reg8', ',', 'reg8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
86 lambda rhs: Lsl(rhs[1], rhs[3]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
87
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
88 self.add_keyword('str')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
89 self.add_instruction(['str', 'reg8', ',', '[', 'reg8', '+', 'imm5', ']'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
90 lambda rhs: Str2(rhs[1], rhs[4], rhs[6]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
91
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
92 self.add_keyword('ldr')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
93 self.add_instruction(['ldr', 'reg8', ',', '[', 'reg8', '+', 'imm5', ']'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
94 lambda rhs: Ldr2(rhs[1], rhs[4], rhs[6]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
95
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
96 self.add_instruction(['str', 'reg8', ',', '[', 'sp', '+', 'imm8', ']'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
97 lambda rhs: Str1(rhs[1], rhs[6]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
98
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
99 self.add_instruction(['ldr', 'reg8', ',', '[', 'sp', '+', 'imm8', ']'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
100 lambda rhs: Ldr1(rhs[1], rhs[6]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
101
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
102 self.add_keyword('pop')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
103 self.add_instruction(['pop', 'reg_list'], lambda rhs: Pop(rhs[1]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
104 self.add_keyword('push')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
105 self.add_instruction(['push', 'reg_list'], lambda rhs: Push(rhs[1]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
106
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
107 self.add_keyword('yield')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
108 self.add_instruction(['yield'], lambda rhs: Yield())
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
109
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
110 self.add_keyword('b')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
111 self.add_keyword('bl')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
112 self.add_instruction(['b', 'ID'], lambda rhs: B(rhs[1].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
113 self.add_instruction(['bl', 'ID'], lambda rhs: Bl(rhs[1].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
114 self.add_keyword('beq')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
115 self.add_keyword('bne')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
116 self.add_keyword('blt')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
117 self.add_keyword('bgt')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
118 self.add_instruction(['beq', 'ID'], lambda rhs: Beq(rhs[1].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
119 self.add_instruction(['bne', 'ID'], lambda rhs: Bne(rhs[1].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
120 self.add_instruction(['blt', 'ID'], lambda rhs: Blt(rhs[1].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
121 self.add_instruction(['bgt', 'ID'], lambda rhs: Bgt(rhs[1].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
122
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
123 self.add_keyword('align')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
124 self.add_instruction(['align', 'imm8'], lambda rhs: Alignment(rhs[1]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
125
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
126 self.add_instruction(['ldr', 'reg8', ',', 'ID'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
127 lambda rhs: Ldr(rhs[1], rhs[3].val))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
128
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
129 # Additional rules:
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
130
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
131 # Register list grammar:
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
132 self.add_rule('reg_list', ['{', 'reg_list_inner', '}'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
133 lambda rhs: rhs[1])
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
134 self.add_rule('reg_list_inner', ['reg_or_range'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
135 lambda rhs: rhs[0])
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
136 self.add_rule('reg_list_inner', ['reg_or_range', ',', 'reg_list_inner'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
137 lambda rhs: rhs[0] | rhs[2])
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
138 self.add_rule('reg_or_range', ['reg8'], lambda rhs: {rhs[0]})
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
139 self.add_rule('reg_or_range', ['lr'], lambda rhs: {LR})
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
140 self.add_rule('reg_or_range', ['pc'], lambda rhs: {PC})
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
141
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
142 self.add_rule('reg_or_range', ['reg8', '-', 'reg8'],
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
143 lambda rhs: register_range(rhs[0], rhs[2]))
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
144
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
145 self.add_keyword('r0')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
146 self.add_keyword('r1')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
147 self.add_keyword('r2')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
148 self.add_keyword('r3')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
149 self.add_keyword('r4')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
150 self.add_keyword('r5')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
151 self.add_keyword('r6')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
152 self.add_keyword('r7')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
153 self.add_keyword('sp')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
154 self.add_keyword('lr')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
155 self.add_keyword('pc')
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
156 self.add_rule('reg8', ['r0'], lambda rhs: R0)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
157 self.add_rule('reg8', ['r1'], lambda rhs: R1)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
158 self.add_rule('reg8', ['r2'], lambda rhs: R2)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
159 self.add_rule('reg8', ['r3'], lambda rhs: R3)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
160 self.add_rule('reg8', ['r4'], lambda rhs: R4)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
161 self.add_rule('reg8', ['r5'], lambda rhs: R5)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
162 self.add_rule('reg8', ['r6'], lambda rhs: R6)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
163 self.add_rule('reg8', ['r7'], lambda rhs: R7)
4d204f6f7d4e Rewrite of assembler parts
Windel Bouwman
parents: 340
diff changeset
164