local carry_flag, a = 0
local result = 0xffff
local i = start
while(true )
do
result = result ~ data[i]
for j = 0, 7
do
a = result
carry_flag = a & 0x0001
result = result >> 1
if carry_flag == 1
then
result = result ~ 0xa001
end
end
i = i + 1
if i == start + n
then
break
end
end
return result
end
用TFT的封装是一样的