示例#1
0
 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))
示例#2
0
 def test_is8_false(self):
     self.assertFalse(vm.is8(0x100)) 
示例#3
0
 def test_is8(self):
     self.assertTrue(vm.is8(0xff))