The BS2sx program goes through some housekeeping: after the directives to the compiler, variables are declared, and typed (p1_x VAR byte, for example). Some bytes are reserved for the transmitted data, and for the local on-robot stuff, as both OI stuff and the RC input stuff are not "read" directly by the 'computing process', but are passed to it from the input process via the SERIN statement.
Think of the CPU as three functions ; input, 'computing', and output.
When you get to the "set the initiallization constants" section, you are preparing to tell the input organizer which bytes to send. As they tell you in the default program, you cannot accept all the bytes the input section has and can send you; you must select a subset to be sent.
You set the constant for a particular byte you want, and then, in the MASTER uP INIT'N section of the default, tempA = (the constant for p3_x shift left once + the constant for p4_x) shift left + the next yada yada ... shifts the first 5 bits into tempA.
dataInitA shifts the 5 bits collected in tempA, along with 3 more, to give eight bits.
Eventually you have 4 bytes of dataInit, A,B,C, and D and then after declaring you want to send it, you wait until the input process is ready to receive, the shift it out. OUTPUT COMA sets the COMA pin to output, LOW sets it to 0 V, INPUT puts the pin into input mode. Lows on COMA and COMB are a signal to the input process. You don't send right away, but you wait, until IN3 goes low, which is the signal the input process is ready to hear from you.
Once that's sent, you get into the main loop, and there the serin command expects to hear as many bytes as you requested, sent in the order IFI has arranged for in their machine code, in the input process, and in the which order you have written your serin (as they cautioned you to do). If you didn't make the c_whatever CON equal 1, it won't be sent; if you don't have it in the correct order (IFI's), your right front wheel might well be executing the commands for your battle-arm. If you don't have the correct number of bytes in the SERIN, you'll see BASIC INIT ERROR.
Think of the input process looking at the 4 bytes, bit by bit, as it sends out data - "is this one that i send ? , if so I will, if not I'll test the next bit, and if it's set, I'll send that". Each bit corresponds to a byte it can send to the computing process
Clearer ?
