本文整理汇总了Python中Memory.put方法的典型用法代码示例。如果您正苦于以下问题:Python Memory.put方法的具体用法?Python Memory.put怎么用?Python Memory.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memory
的用法示例。
在下文中一共展示了Memory.put方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: i_ISZ
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def i_ISZ(indirect, address, instruction):
global PC
value = (Memory.get(address, indirect) + 1) & WORDMASK
Memory.put(value, address, indirect)
if value == 0:
PC = (PC + 1) & WORDMASK
Trace.itrace('ISZ', indirect, address)
return 3 if indirect else 2
示例2: i_JMS
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def i_JMS(indirect, address, instruction):
global PC
jmsaddr = EFFADDR(address)
if indirect:
jmsaddr = Memory.get(jmsaddr, False)
Memory.put(PC, jmsaddr, False)
PC = (jmsaddr + 1) & PCMASK
Trace.itrace('JMS', indirect, address)
return 3 if indirect else 2
示例3: i_XAM
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def i_XAM(indirect, address, instruction):
global AC
if indirect:
address = Memory.get(address, False)
tmp = Memory.get(address, False)
Memory.put(AC, address, False)
AC = tmp
Trace.itrace('XAM', indirect, address)
return 3 if indirect else 2
示例4: visit
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def visit(self, node):
fun = self.functionStack.get(node.id)
function_memory = Memory(node.id)
for actualArg, argExpr in zip(fun.args.accept(self), node.arglist.accept(self)):
function_memory.put(actualArg, argExpr)
self.variableStack.push(function_memory)
try:
fun.body.accept(self)
except ReturnValueException as e:
return e.value
finally:
self.variableStack.pop()
示例5: visit
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def visit(self, node):
fun = self.memoryStack.get(node.name)#EXCEPTION
funMemory = Memory(node.name)
for argExpr, actualArg in zip(node.args.children, fun.args.children):
funMemory.put(actualArg.accept(self), argExpr.accept(self))
self.memoryStack.push(funMemory)
try:
fun.body.accept(self)
except ReturnValueException as e:
return e.value
finally:
self.memoryStack.pop()
示例6: visit
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def visit(self, node):
fun = self.globalMemory.get(node.name)
funFrame = Memory(node.name)
if (fun.arg_list != None):
for arg, val in list(zip(fun.arg_list.children, node.expr.children)):
funFrame.put(arg.accept(self), val.accept(self))
self.functionMemory.push(funFrame)
self.isFunctionCompound = True
try:
fun.compound_instr.accept(self)
except ReturnValueException as e:
return e.value
finally:
self.functionMemory.pop()
示例7: visit
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def visit(self, node):
function = self.memoryStack.get(node.id)
functionMemory = Memory(node.id)
for argId, argExpr in zip(function.arglist.arg_list, node.expression_list.expressions):
functionMemory.put(argId.accept(self), argExpr.accept(self))
self.memoryStack.push(functionMemory)
self.isFunctionScope = True
try:
function.compound_instr.accept(self)
except ReturnValueException as e:
return e.value
finally:
self.isFunctionScope = False
self.memoryStack.pop()
示例8: visit
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def visit(self, node, create_memory=True):
fun = self.memory_stack.get(node.id)
fun_memory = Memory(node.id)
if node.expr_list is not None:
for arg_expression, actual_arg in zip(node.expr_list.expr_list, fun.args_list.arg_list):
arg = actual_arg.accept(self)
expr = arg_expression.accept(self)
fun_memory.put(arg, expr)
self.memory_stack.push(fun_memory)
try:
fun.comp_instr.accept(self, False)
except ReturnValueException as e:
return e.value
finally:
self.memory_stack.pop()
示例9: i_DAC
# 需要导入模块: import Memory [as 别名]
# 或者: from Memory import put [as 别名]
def i_DAC(indirect, address, instruction):
address = EFFADDR(address)
Memory.put(AC, address, indirect)
Trace.itrace('DAC', indirect, address)
return 3 if indirect else 2