Closed vbmacher closed 9 years ago
For example, read(2,3) for 11011111 did not return 011.
read(2,3)
11011111
011
a = 11011111 & 00111111 << 2 = 01111100 b = 11011111 & 11111000 >> 3 = 00011011
You cannot do result = (a | b) if you operate on the same byte, only if start+length > 8.
result = (a | b)
start+length > 8
read(6,3): a = 11011111 & 00000011 << 1 = 00000110 b = 00000000 & 10000000 >> 7 = 00000000
result = a|b, correct.
result = a|b
For example,
read(2,3)
for11011111
did not return011
.You cannot do
result = (a | b)
if you operate on the same byte, only ifstart+length > 8
.result = a|b
, correct.