本文整理汇总了Python中utility.Bits.limitTo8Bits方法的典型用法代码示例。如果您正苦于以下问题:Python Bits.limitTo8Bits方法的具体用法?Python Bits.limitTo8Bits怎么用?Python Bits.limitTo8Bits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utility.Bits
的用法示例。
在下文中一共展示了Bits.limitTo8Bits方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _checkInterrupts
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def _checkInterrupts(self):
if self.iff1:
self.halted = Bits.reset()
self.iff1 = Bits.reset()
self.iff2 = Bits.reset()
self.ram[--self.SP] = Bits.limitTo8Bits(self.pc)
self.ram[--self.SP] = self.pc >> 8
self.R += 1
if self.im == 0 or self.im == 1:
self.PC = 0x0038
示例2: inc8
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def inc8(cpu, opcode, logger):
index = (opcode >> 3) & 7
oldValue = cpu.regs[index]
cpu.regs[index] = Bits.limitTo8Bits(cpu.regs[index] + 1)
cpu.NFlag = Bits.reset()
cpu.ZFlag = Bits.isZero(cpu.regs[index])
cpu.HFlag = Bits.halfCarrySub(oldValue, cpu.regs[index])
cpu.PVFlag = True if oldValue == 0x7f else False
cpu.SFlag = Bits.isNegative(cpu.regs[index])
cpu.m_cycles, cpu.t_states = 1, 4
logger.info("INC {}".format(IndexToReg.translate8Bit(index)))
示例3: D
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def D(self, value):
self.regs[D] = Bits.limitTo8Bits(value)
示例4: C
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def C(self, value):
self.regs[C] = Bits.limitTo8Bits(value)
示例5: B
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def B(self, value):
self.regs[B] = Bits.limitTo8Bits(value)
示例6: F
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def F(self, value):
self.regs[F] = Bits.limitTo8Bits(value)
示例7: test_bits_limitTo8Bits_correctly_limits_value_to_8_bits
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def test_bits_limitTo8Bits_correctly_limits_value_to_8_bits(self):
value = 0b1101010010
self.assertEquals(0b1010010, Bits.limitTo8Bits(value))
示例8: R
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def R(self, value):
self.r = Bits.limitTo8Bits(value)
示例9: AF
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def AF(self, value):
value = Bits.limitTo16Bits(value)
self.regs[A] = value >> 8
self.regs[F] = Bits.limitTo8Bits(value)
示例10: BCPrim
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def BCPrim(self, value):
value = Bits.limitTo16Bits(value)
self.regsPri[B] = value >> 8
self.regsPri[C] = Bits.limitTo8Bits(value)
示例11: BC
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def BC(self, value):
value = Bits.limitTo16Bits(value)
self.regs[B] = value >> 8
self.regs[C] = Bits.limitTo8Bits(value)
示例12: DEPrim
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def DEPrim(self, value):
value = Bits.limitTo16Bits(value)
self.regsPri[D] = value >> 8
self.regsPri[E] = Bits.limitTo8Bits(value)
示例13: DE
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def DE(self, value):
value = Bits.limitTo16Bits(value)
self.regs[D] = value >> 8
self.regs[E] = Bits.limitTo8Bits(value)
示例14: HLPrim
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def HLPrim(self, value):
value = Bits.limitTo16Bits(value)
self.regsPri[H] = value >> 8
self.regsPri[L] = Bits.limitTo8Bits(value)
示例15: HL
# 需要导入模块: from utility import Bits [as 别名]
# 或者: from utility.Bits import limitTo8Bits [as 别名]
def HL(self, value):
value = Bits.limitTo16Bits(value)
self.regs[H] = value >> 8
self.regs[L] = Bits.limitTo8Bits(value)