當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。