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


Python base.BaseInstruction类代码示例

本文整理汇总了Python中corewar.core.instrset.base.BaseInstruction的典型用法代码示例。如果您正苦于以下问题:Python BaseInstruction类的具体用法?Python BaseInstruction怎么用?Python BaseInstruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BaseInstruction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, p_arg1, p_arg2, p_arg3, p_arg4, p_arg5, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Ll, 7, 0b1111, 0b0011, p_line)
     self.m_arg1 = p_arg1
     self.m_arg2 = p_arg2
     self.m_arg3 = p_arg3
     self.m_arg4 = p_arg4
     self.m_arg5 = p_arg5
开发者ID:psycofdj,项目名称:corewar,代码行数:7,代码来源:ll.py

示例2: __str__

 def __str__(self):
     l_value = (self.m_arg5 << 12) + (self.m_arg4 << 8) + (self.m_arg3 << 4) + self.m_arg2
     return  "ll r%s, %s%s%s%s(%d) : %s" % (self.m_arg1,
                                            Quartet(self.m_arg2),
                                            Quartet(self.m_arg3),
                                            Quartet(self.m_arg4),
                                            Quartet(self.m_arg5),
                                            l_value,
                                            BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:9,代码来源:ll.py

示例3: __str__

 def __str__(self):
     l_n = (self.m_arg3 << 4) + self.m_arg2
     l_m = (self.m_arg5 << 4) + self.m_arg4
     return  "ldb r%s, %s%s(%d), %s%s(%d) : %s" % (self.m_arg1,
                                                   Quartet(self.m_arg2),
                                                   Quartet(self.m_arg3),
                                                   l_n,
                                                   Quartet(self.m_arg4),
                                                   Quartet(self.m_arg5),
                                                   l_m,
                                                   BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:11,代码来源:ldb.py

示例4: __str__

 def __str__(self):
     l_n = (self.m_arg3 << 4) + self.m_arg2
     l_m = (self.m_arg5 << 4) + self.m_arg4
     return  "stb [r%s(%d)], %s%s(%d), %s%s(%d) : %s" % (self.m_arg1,
                                                         self.m_ship.getRegister(self.m_arg1).getValue(),
                                                         Quartet(self.m_arg2),
                                                         Quartet(self.m_arg3),
                                                         l_n,
                                                         Quartet(self.m_arg4),
                                                         Quartet(self.m_arg5),
                                                         l_m,
                                                         BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:12,代码来源:stb.py

示例5: __str__

 def __str__(self):
     return  "mode %s : %s" % (self.idxToMode(self.m_arg1).Name,
                               BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:3,代码来源:mode.py

示例6: __init__

 def __init__(self, p_arg1, p_arg2, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Add, 3, 0b1000, None, p_line)
     self.m_arg1 = p_arg1
     self.m_arg2 = p_arg2
开发者ID:psycofdj,项目名称:corewar,代码行数:4,代码来源:add.py

示例7: __str__

 def __str__(self):
     l_value = (self.m_arg3 << 4) + self.m_arg2
     return  "lc r%s %d : %s" % (self.m_arg1,
                                 l_value,
                                 BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:5,代码来源:lc.py

示例8: __init__

 def __init__(self, p_arg1, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Mode, 3, 0b1111, 0b1101, p_line)
     self.m_arg1 = p_arg1
开发者ID:psycofdj,项目名称:corewar,代码行数:3,代码来源:mode.py

示例9: __init__

 def __init__(self, p_arg1, p_arg2, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Swp, 4, 0b1111, 0b0100, p_line)
     self.m_arg1 = p_arg1
     self.m_arg2 = p_arg2
开发者ID:psycofdj,项目名称:corewar,代码行数:4,代码来源:swp.py

示例10: __init__

 def __init__(self, p_arg1, p_arg2, p_arg3, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Lc, 5, 0b1111, 0b0010, p_line)
     self.m_arg1 = p_arg1
     self.m_arg2 = p_arg2
     self.m_arg3 = p_arg3
开发者ID:psycofdj,项目名称:corewar,代码行数:5,代码来源:lc.py

示例11: __init__

 def __init__(self, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Nop, 1, 0b0001, None, p_line)
开发者ID:psycofdj,项目名称:corewar,代码行数:2,代码来源:nop.py

示例12: __str__

 def __str__(self):
     return  "check : %s" % (BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:2,代码来源:check.py

示例13: __init__

 def __init__(self, p_line = 0):
     BaseInstruction.__init__(self, Modes.Instr.Crash, 1, 0b0000, None, p_line)
开发者ID:psycofdj,项目名称:corewar,代码行数:2,代码来源:crash.py

示例14: __str__

 def __str__(self):
     return  "rol r%s(%d) %d : %s" % (self.m_arg1,
                                      self.m_ship.getRegister(self.m_arg1).getValue(),
                                      self.m_arg2,
                                      BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:5,代码来源:rol.py

示例15: __str__

 def __str__(self):
     return  "stat r%s %d : %s" % (self.m_arg1,
                                   self.m_arg2,
                                   BaseInstruction.__str__(self))
开发者ID:psycofdj,项目名称:corewar,代码行数:4,代码来源:stat.py


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