def runSimulator(): if request.method == "POST": main.runSimulator() reg = main.getRegisters() memory = main.getMemlocs() memoryData = main.getMemData() stack = main.getStack() print("STACK : ", stack) return json.dumps({'status':'OK', 'reg':reg, 'memory':memory, 'memoryData':memoryData, 'stack':stack})
def loadSimulator(): if request.method == "POST": main.resetAll() data = request.get_json() fileName = data['file'] offset = data['offset'] main.runload(int(offset)) fileName = fileName+'.loaded' # print(fileName) main.runloader(fileName, offset) reg = main.getRegisters() memory = main.getMemlocs() memoryData = main.getMemData() stack = main.getStack() # print("ASDFASDFASFDASFDSFAFDASFASDF", memoryData) return json.dumps({'status':'OK', 'reg':reg, 'memory':memory , 'memoryData':memoryData, 'stack':stack})