Mercurial > lcfOS
diff python/ir/instruction.py @ 157:8f3924b6076e
Added some code generator things
author | Windel Bouwman |
---|---|
date | Sun, 03 Mar 2013 18:14:35 +0100 |
parents | b28a11c01dbe |
children | 9683a4cd848f |
line wrap: on
line diff
--- a/python/ir/instruction.py Sun Mar 03 15:50:34 2013 +0100 +++ b/python/ir/instruction.py Sun Mar 03 18:14:35 2013 +0100 @@ -18,13 +18,17 @@ def __init__(self, operation, value1, value2): assert value1 assert value2 - print('operation is in binops:', operation in BinOps) + #print('operation is in binops:', operation in BinOps) # Check types of the two operands: self.value1 = value1 self.value2 = value2 self.operation = operation -class LoadInstruction(Instruction): - def __init__(self, ptr, name, insertBefore): - self.setName(name) +class AddInstruction(BinaryOperator): + def __init__(self, a, b): + super().__init__('add', a, b) +class ImmLoadInstruction(Instruction): + def __init__(self, value): + self.value = value +