def loadSimulator(): if request.method == "POST": data = request.get_json() fileName = data['file'] print data offset = data['offset'] main.runload(int(offset)) fileName = fileName+'.8085' main.runloader(fileName, offset) reg = main.getRegisters() memory = main.getMemlocs() stack = main.getStack() print stack return json.dumps({'status':'OK', 'reg':reg, 'memory':memory , 'stack':stack})
def calculate(*args): finalfile = main.x[0].split('.')[0] + '.8085' str1 = '' str1 = str1 + 'Interpreting...........\nRunning Assembler \n' meters.set(str1) main.runass() str1 = str1 + 'Assembler Completed \n' + 'Running Linker \n' meters.set(str1) main.runlin() str1 = str1 + 'Linker Completed \n' + 'Running Loader \n' meters.set(str1) main.runload() str1 = str1 + 'Loading Complete \n' + '\t\tFile is ready to simulate.\n' + '\t\tFile name is : ' + finalfile + '\n' meters.set(str1)
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})