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
L R0,ROW L R1,COL BCTR R0,0 BCTR R1,0 MH R0,=H'80' AR R1,R0 SLL R1,2 STCM R1,B'0010',SBACMD SRL R1,2 STCM R1,B'0001',SBACMD+1 NC SBACMD(2),=X'3F3F' TR SBACMD(2),TBL3270 SBACMD DC XL2'0000' TBL3270 DC X'40C1C2C3C4C5C6C7C8C94A4B4C4D4E4F' DC X'50D1D2D3D4D5D6D7D8D95A5B5C5D5E5F' DC X'6061E2E3E4E5E6E7E8E96A6B6C6D6E6F' DC X'F0F1F2F3F4F5F6F7F8F97A7B7C7D7E7F' |