So am I right in thinking that the DAT_OUT byte:
Yes, you have all of that correct.
CHECKSUM..
Because this is the last BYTE to be read / run in the program sequence.
We are dealing with BITs here.
Code:
DAT_OUT.0[1]=~GPIO.3 'BIT #1 of DAT_OUT
DAT_OUT.0[2]=~GPIO.4 'BIT #2 of DAT_OUT
Back to what you have above that either BIT#1 or BIT#2 will be changed when a switch is pressed, DAT_OUT will be either
%10101011
or
%10101101
So...
CHK_SUM = (DAT_OUT * 2)
Will be
CHK_SUM = (%10101011 * 2)
or
CHK_SUM = (%10101101 * 2)
Bookmarks