The buffer addresses used by the various commands such as SBA, RA and EUA are encoded using two six bit numbers translated into two eight bit values. The best way to understand how this encoding works is to work through an example.
For our example we will calculate the buffer address for Row = 12 and Column = 40
First we must subtract one from both the row and column values since they are based relative to zero. We then multiply the row value by 80 (number of columns in a row) and add in the column offset:
((Row -1) * 80) + (Col - 1) = (( 12 - 1) * 80) + (40 - 1) = 919
Next we need to get the binary representation of the buffer offset which is x'397' or b'11 1001 0111' (this assumes that I did the math correctly). Next we split the binary value into two groups of six bits: b'00 1110' and b'01 0111'. Next we need to make use of a table to translate each of these six bit binary values into their eight bit encoding. I have provided the translation table to help with the process.
If we look up our two values in this table we get the translation x'4E' and x'D7'. To set the buffer address to row 12 and column 40 we would then use the command: x'114ED7'.
This process is pretty involved using pencil and paper but is very easy to implement in software. If you are coding data streams by hand I have provided a table to help make the process a little easier: Buffer Address Conversion Table Using the table we can easily determine the Row 12, Column 40 is buffer address x'4ED7'.
The WCC and Field attribute bytes are converted using the same translation table. The process is just a lot simpler since we do not first have to do all that math
SBACMD DC XL2'0000'
TBL3270 DC X'40C1C2C3C4C5C6C7C8C94A4B4C4D4E4F'