def _data_int(self, value): """ Insert numeric data at the current position. """ if vm.is8(value) or vm.is8s(value): self.mem[self.position] = vm.mask8(value) self.position += 1 elif vm.is16(value): self.mem[self.position::2] = value self.position += 2 else: raise OverflowError('Value out of range: ${:X} {:d}' .format(value, value))
def test_is8_false(self): self.assertFalse(vm.is8(0x100))
def test_is8(self): self.assertTrue(vm.is8(0xff))