def Return(self, i): code = list() #if len(self.code) >= 90 and len(self.code) < 110: #code = [ #(vm.IMM, 3, len(self.code), 'DEBUG'), #(vm.PRNT, 3, 0, 'DEBUG'), #(vm.PRNT, 2, 0, 'DEBUG'), #(vm.EXIT, 0, 0, 'DEBUG'), #] code += [ x.addl(x.cint(4), x.esp), x.jmp(x.mem(x.esp, -4, True)), #x.ret(), ] return code
def J(self, i): # self.labels[i.a] = None code = [x.jmp(i.a.name)] return code
def Return(self, i): """Generate code to return from the current function""" return [x.addl(x.cint(4), x.esp), x.jmp(x.mem(x.esp, -4, True))]