[comp.lang.asm370] 3270 screen buffer address computation

LDW@USCMVSA.BITNET (Leonard D Woren) (03/14/90)

Once you determine the screen size, here's how you build the 3270 SBA:

         LH    R14,ROW                  get row number
         BCTR  R14,0                    make it origin 0
         MH    R14,WIDTH                multiply by screen width
         AH    R14,COL                  add column number
         BCTR  R14,0                    make it origin 0
         SRDL  R14,6                    get low order six bits into R15
         SRL   R15,32-6                 shift to low end of register
*  R1 -> SBA output area, starting with X'11'
         STC   R14,1(,R1)               set down hi order 6 bits
         STC   R15,2(,R1)               set down lo order 6 bits
         TR    1(2,R1),TR3270           translate to valid 3270 chars
         ...
TR3270   DC    X'40C1C2C3C4C5C6C7C8C94A4B4C4D4E4F'                      08920012
         DC    X'50D1D2D3D4D5D6D7D8D95A5B5C5D5E5F'                      08930012
         DC    X'6061E2E3E4E5E6E7E8E96A6B6C6D6E6F'                      08940012
         DC    X'F0F1F2F3F4F5F6F7F8F97A7B7C7D7E7F'                      08950012