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_is8s_too_high(self): self.assertFalse(vm.is8s(256))
def test_is8s_too_low(self): self.assertFalse(vm.is8s(-129))
def test_is8s_high(self): self.assertTrue(vm.is8s(255))
def test_is8s_low(self): self.assertTrue(vm.is8s(-128))