Mercurial > lcfOS
comparison python/ppci/core/instruction.py @ 104:ed230e947dc6
Added hexviewer
author | windel |
---|---|
date | Sun, 30 Dec 2012 22:31:55 +0100 |
parents | 6efbeb903777 |
children | 9e552d34bd60 |
comparison
equal
deleted
inserted
replaced
103:28a35161ef23 | 104:ed230e947dc6 |
---|---|
1 | 1 |
2 from .value import Value | 2 from .value import Value |
3 | 3 |
4 class Instruction(Value): | 4 class Instruction(Value): |
5 """ | 5 """ Base class for all instructions. """ |
6 Base class for all instructions. | |
7 """ | |
8 pass | 6 pass |
9 | 7 |
10 class CallInstruction(Instruction): | 8 class CallInstruction(Instruction): |
11 pass | 9 pass |
12 | 10 |
13 class BinaryOperator(Instruction): | 11 class BinaryOperator(Instruction): |
14 pass | 12 def __init__(self, operation, value1, value2): |
13 # Check types of the two operands: | |
14 self.value1 = value1 | |
15 self.value2 = value2 | |
16 self.operation = operation | |
15 | 17 |
16 class LoadInstruction(Instruction): | 18 class LoadInstruction(Instruction): |
17 def __init__(self, ptr, name, insertBefore): | 19 def __init__(self, ptr, name, insertBefore): |
18 self.setName(name) | 20 self.setName(name) |
19 | 21 |