thanks for that henrik lets see if we can agree to the problem definition it's possible the badgers have moved the goalposts.Richards code below shows (I think) the ~operator working but not really, at least not that I can see, in the exact way you're using it
my assumption is
the elements of a byte array [of less than 256 bytes] are summed from the first element to the penulitmate element into a word var
the low byte of this word var is inverted and placed into the last element.
the allegation is that :-
{note .w0 is the word sum of the array}
can produce and incorrect result in that, when read back array[z] is always $fdCode:array[z] = ~w0 ; where w0 ia a word and the [byte]array is of z+1 elements
or that
which i assume to beIF I DO NOT INVERT THE BYTE VALUE THE CRC RECEIVED IS CORRECT
is correct where asCode:array[z] = w0.lowbyte ; not inverted
Code:array[z] = w0.lowbyte array[z] = ~array[z] ; inverted
can produce and incorrect result in that, when read back array[z] is always $fd




Bookmarks