Hi,
I'm testing lines of code with firstly ORs. I'm using windows10 calculator then I will try programming Oshonsoft to check the answer.
e,g, To set a byte, perhaps 4x 'OR'ed lines are used. byte = a OR b OR c OR d. e,g, 10000000, 00100000,00001100,00000010
I notice that when the calculator is set to BYTE when bit 7 is 1 then the DECIMAL shows -1. If I set it to WORD, then it shows 255. I'm sure it's something to do with one and twos compliment, but i'm not sure how it affects the result.
In Oshonsoft, this seems to work.
byte = a OR b
byte = byte OR c
byte = byte OR d
How could -1 affect the result, if -1 is what happens, when dealing with only bytes?
EDIT: It appears that the Windows10 calculator only deals with 2s compliment, so hopefully won't affect my results, if I just ignore the -sign.
C.