1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# -*- coding: utf-8 -*-
#
# AWL simulator - blocks
# Copyright 2012-2013 Michael Buesch <m@bues.ch>
#
# Licensed under the terms of the GNU General Public License version 2.
#
from awllabels import *
from util import *
class Block(object):
def __init__(self, insns, index):
self.insns = insns
self.labels = None
self.index = index
if insns:
self.labels = AwlLabel.resolveLabels(insns)
def __repr__(self):
return "Block %d" % self.index
class OB(Block):
def __init__(self, insns, index):
Block.__init__(self, insns, index)
def __repr__(self):
return "OB %d" % self.index
class FB(Block):
def __init__(self, insns, index):
Block.__init__(self, insns, index)
def __repr__(self):
return "FB %d" % self.index
class SFB(Block):
def __init__(self, index):
Block.__init__(self, None, index)
def run(self, cpu, dbOper):
pass # Reimplement this method
def __repr__(self):
return "SFB %d" % self.index
class FC(Block):
def __init__(self, insns, index):
Block.__init__(self, insns, index)
def __repr__(self):
return "FC %d" % self.index
class SFC(Block):
def __init__(self, index):
Block.__init__(self, None, index)
def run(self, cpu):
pass # Reimplement this method
def __repr__(self):
return "SFC %d" % self.index
|