-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
64 lines (48 loc) · 1.05 KB
/
main.py
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
64
import assembler, linker, loader, simulation
x = []
# Run Assembler Pass1
def runass():
assembler.pass1(x)
# Run Linker
def runlin():
linker.link(x)
# Run Loader
def runload(offset=0):
loader.convert(x, offset)
simulation.reg['PC'] = offset
# Get symbols table
def getSymTable():
return assembler.symtab
# Get literals table
def getLitTable():
return assembler.littab2
# Get Global table
def getGlobTable():
return assembler.globtab
# Get Extern table
def getExtTable():
return {}
return assembler.extTable
# Get If table
def getifTable():
return assembler.iftable
# Run Loader
def runloader(file, offset=0):
simulation.load(file, offset)
# Simulation
def runSimulator():
simulation.callbackf()
# Get register values
def getRegisters():
return simulation.reg
# get Stack of simulator
def getStack():
return simulation.stack
# get memory locations of simulator
def getMemlocs():
return simulation.memory
# Get the stored values of variables in the memory
def getMemData():
return simulation.MainMemoryValues
def resetAll():
simulation.resetAll()