XOR question
Using these data bytes as an example:
$01, $0A, $03, $00, $00
How do I code this to XOR these bytes for a checksum answer? I see the checksum on the logic trace is $08 and it figures with my calculator that way but I don't know how to put it into code.
Would it be as simple as chksum := ($01 ^ $0A ^ $03 ^ $00 ^ $00) ?
$01, $0A, $03, $00, $00
How do I code this to XOR these bytes for a checksum answer? I see the checksum on the logic trace is $08 and it figures with my calculator that way but I don't know how to put it into code.
Would it be as simple as chksum := ($01 ^ $0A ^ $03 ^ $00 ^ $00) ?

Comments
PUB Demo | d, i, s, chksum ser.Start(RX, TX, 0, 9_600) ' communicate with 4D display term.start(31, 30, %0000, 115_200) ' start terminal using PST outa[RST]~~ dira[RST]~~ ' Set RST pin as output pause(500) term.str(@ver) ' display version ' Goto Form3 repeat i from 0 to 4 s := byte[@form3][i] ser.tx(s) chksum := (chksum ^ i) ser.tx(chksum) term.hex(chksum, 4) DAT form3 byte $01, $0A, $03, $00, $00It calculates wrong. It shows $04 instead of $08.
PUB Demo | d, i, s, chksum ser.Start(RX, TX, 0, 9_600) ' communicate with 4D display term.start(31, 30, %0000, 115_200) ' start terminal using PST outa[RST]~~ dira[RST]~~ ' Set RST pin as output pause(500) term.str(@ver) ' display version ' Goto Form3 repeat i from 0 to 4 s := byte[@form3][i] ser.tx(s) chksum := (chksum ^ s) ser.tx(chksum) term.hex(chksum, 4)without XOR or an extra register - mini challenge)
chksum := 0 repeat i from 0 to 70 s := byte[@text][i] ser.tx(s) chksum ^= s ser.tx(chksum)chksum := 0 repeat i from 0 to 70 s := text[i] ser.tx(s) chksum ^= s ser.tx(chksum)Andy