当前位置: 首页>>代码示例>>Python>>正文


Python Memory.put方法代码示例

本文整理汇总了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
开发者ID:Goku0858756,项目名称:rzzzwilson,代码行数:11,代码来源:MainCPU.py

示例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
开发者ID:Goku0858756,项目名称:rzzzwilson,代码行数:12,代码来源:MainCPU.py

示例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
开发者ID:Goku0858756,项目名称:rzzzwilson,代码行数:12,代码来源:MainCPU.py

示例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()
开发者ID:Kurtzz,项目名称:CompilationTheory,代码行数:14,代码来源:Interpreter.py

示例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()
开发者ID:atryda12,项目名称:Compilation-Theory,代码行数:14,代码来源:Interpreter.py

示例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()
开发者ID:WiktorJ,项目名称:Compilation-Theory,代码行数:16,代码来源:Interpreter.py

示例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()
开发者ID:tmachows,项目名称:kompilatory,代码行数:16,代码来源:Interpreter.py

示例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()
开发者ID:salceson,项目名称:kompilatory,代码行数:17,代码来源:Interpreter.py

示例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
开发者ID:Goku0858756,项目名称:rzzzwilson,代码行数:7,代码来源:MainCPU.py


注:本文中的Memory.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。