Date: Thu, 18 Jul 85 21:18:22 PDT From: VSS7853@UCLAVM To: DFTCU@CUVMA Subject: Tools for Ascii/Ebcdic conversion tables for TSO Kermit. Enclosed are three Fortran 77 programs I wrote as aids to installing Kermit-TSO when non-standard TCAM tables are used by MVS to communicate with Ascii terminals. The first two programs, ATOE.FOR and ETOA.FOR take the actual tables used by TCAM, which are obtained from the communication's people at one's installation, and generate assembler source code to replace the tables in Kermit. The third, TCAM.FOR, takes the output of the first two and checks whether the ETOA table is indeed the inverse of the ATOE on the printable subset as required for Kermit to operate. If the test fails, Kermit will not run with the existing TCAM tables. I suspect, however, that so long as all of the Ascii printables map to distinct Ebcdic representations, and so long as the range of the Ebcdic-to-Ascii contains all the Ascii printables, that Kermit could still be made to work by employing an ETOA which is the inverse of TCAM's Ascii-to-Ebcdic, an ATOE which is the inverse of TCAM's Ebcdic-to-Ascii, and an additional ETOA with range contained in the printable subset (and null). This would require a bit of analysis and a modest amount of reprogramming on someone's part but it might add to the number of mvs systems which support Kermit. The listings include actual output which includes an echo of the input. The programs were developed on VAX but the language should be standard 77 except for the Z format extension. I hope this helps someone. sincerely - Glenn E. Thobe EE dept. UCLA iva3get.uclamvs (bitnet) =========================================================================== * atoe.for - convert TCAM ascii-to-ebcdic to Kermit format * Glenn E. Thobe/ 7 JUL 85 * 6701 De Soto Av. #135/ Canoga Park, CA 91303 * IVA3GET@UCLAMVS (BITNET) implicit integer(a - z) integer tcam(0:255), atoe(0:127) character*8 type(4) data type /'even', 'odd', 'space', 'mark'/ read (9, 1000) tcam 1000 format (4(1x, 4z2.2)) write (*, 1000) tcam write (10, 1000) tcam do 200 j = 1, 4 do 100 i = 0, 127 inchar = i call bitrev (inchar, otchar, type(j)) atoe(i) = tcam(otchar) 100 continue write (10, *) ' parity:', type(j) write (10, 2000) atoe 2000 format (' DC X''', 16z2.2, '''') print *, ' parity:', type(j) write (*, 2000) atoe 200 continue end subroutine bitrev (inchar, otchar, type) implicit integer(a - z) character*(*) type dimension bit(8) data bit /1, 2, 4, 8, 16, 32, 64, 128/ otchar = 0 prty = 0 do 100 i = 1, 7 if (iand(inchar, bit(i)) .ne. 0) then otchar = ior(otchar, bit(9 - i)) * /* generates even parity prty = mod(prty + 1, 2) endif 100 continue if (type .eq. 'even') then otchar = otchar + prty elseif (type .eq. 'odd') then otchar = otchar + 1 - prty elseif (type .eq. 'space') then otchar = otchar + 0 elseif (type .eq. 'mark') then otchar = otchar + 1 else stop ' *** error: unknown parity type' endif end 3F3F3F7C 3F403F3F 3F3FD7D7 F0F03F97 Ascii-to-ebcdic tables from TCAM. 6D6DC8C8 4D4D3F88 18183FE7 3FF8A73F This is both input & output to ATOE. 3F37C4C4 5B5B3F84 04043FE3 3FF4A33F WARNING: don't use these tables, they 0C0C3FD3 3F6B933F 3F3FCFE1 4C4C3F3F are nonstandard and non-invertible and 3F3FC2C2 7F7F3F82 343F3FD9 3FF2993F Kermit will not work with them. 15153FD1 3F5C913F 3F3FE9E9 7A7A3FA9 3F3F3FC6 3F50863F 3F3FE5E5 F6F63FA5 3F0ED5D5 4B4B3F95 3F3F3F4F 3F6E3F3F 3F3FC1C1 5A5A3F81 11113FD8 3FF1983F 05053FC9 3F5D893F 3F3FE8E8 F9F93FA8 2D2D3FC5 3F6C853F 3F3FE4E4 F5F53FA4 3F37D4D4 60603F94 3F3F3F49 3F7E3F3F 3F3F3FC3 3F7B833F 3F37E2E2 F3F33FA2 3F0BD2D2 4E4E3F92 3F3F3F79 3F5E3F3F 3F2FC7C7 7D7D3F87 3F3F3FE6 3FF7A63F 0F0F3FD6 3F61963F 3F3F6D6D 6F6F3F07 parity:even DC X'3F3F3F3F372D3F2F6D05150B0C370E0F' Ascii-to-ebcdic table DC X'3F113437043F3F3F183F3F3F3F3F3F3F' output by ATOE in DC X'405A7F7B5B6C507D4D5D5C4E6B604B61' assembler source DC X'F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F' language in each of DC X'7CC1C2C3C4C5C6C7C8C9D1D2D3D4D5D6' four possible formats. DC X'D7D8D9E2E3E4E5E6E7E8E979CF494F6D' DC X'3F818283848586878889919293949596' DC X'979899A2A3A4A5A6A7A8A93F3F3F3F07' parity:odd DC X'3F3F3F3F3F2D3F3F6D05153F0C3F3F0F' DC X'3F113F3F043F3F3F183F3F3F3F3F3F3F' DC X'3F5A7F3F5B3F3F7D4D3F3F4E3F604B3F' DC X'F03F3FF33FF5F63F3FF97A3F4C3F3F6F' DC X'3FC1C23FC43F3FC7C83F3FD23FD4D53F' DC X'D73F3FE23FE4E53F3FE8E93FE13F3F6D' DC X'3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F' DC X'3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F' parity:space DC X'3F3F3F3F3F2D3F3F6D05153F0C3F3F0F' DC X'3F11343F043F3F3F183F3F3F3F3F3F3F' DC X'3F5A7F3F5B3F3F7D4D3F3F4E3F604B3F' DC X'F03F3FF33FF5F63F3FF97A3F4C3F3F6F' DC X'3FC1C23FC43F3FC7C83F3FD23FD4D53F' DC X'D73F3FE23FE4E53F3FE8E93FCF3F3F6D' DC X'3F3F3F833F85863F3F89913F933F3F96' DC X'3F98993FA33F3FA6A73F3F3F3F3F3F3F' parity:mark DC X'3F3F3F3F372D3F2F6D05150B0C370E0F' DC X'3F113F37043F3F3F183F3F3F3F3F3F3F' DC X'405A7F7B5B6C507D4D5D5C4E6B604B61' DC X'F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F' DC X'7CC1C2C3C4C5C6C7C8C9D1D2D3D4D5D6' DC X'D7D8D9E2E3E4E5E6E7E8E979E1494F6D' DC X'3F81823F843F3F87883F3F923F94953F' DC X'973F3FA23FA4A53F3FA8A93F3F3F3F07' =============================================================================== * etoa.for - convert TCAM ebcdic-to-ascii to Kermit form * Glenn E. Thobe/ 7 JUL 85 * 6701 De Soto Av. #135/ Canoga Park, CA 91303 * IVA3GET@UCLAMVS (BITNET) implicit integer(a - z) integer etoa(0:255) read (9, 1000) etoa 1000 format (4(1x, 4z2.2)) write (*, 1000) etoa write (10, 1000) etoa do 100 i = 0, 255 inchar = etoa(i) call bitrev (inchar, otchar) etoa(i) = otchar 100 continue write (10, 2000) etoa 2000 format (' DC X''', 16z2.2, '''') write (*, 2000) etoa end subroutine bitrev (inchar, otchar) implicit integer(a - z) dimension bit(8) data bit /1, 2, 4, 8, 16, 32, 64, 128/ otchar = 0 do 100 i = 2, 8 if (iand(inchar, bit(i)) .ne. 0) then otchar = ior(otchar, bit(9 - i)) endif 100 continue end 008141C0 28905CFF 5C5C5CD1 30B171F0 Ebcdic-to-ascii tables from TCAM. 098848C9 5C501100 18995C5C 39B878F9 This is both input & output to ETOA. 5C5C395C 5C50E8D8 5C5C5C5C 5CA060E1 WARNING: don't use these tables. 5C5C695C 485C5C21 5C5C5C56 28A95C59 They are nonstandard and non- 055C5C5C 5C5C5C5C 5CBB5C74 3C14D43F invertible and Kermit won't work 655C5C5C 5C5C5C5C 5C5C8424 5595DD7E with them. B4F55C5C 5C5C5C5C 5C5C3F35 A5FA7DFC 5C5C5C5C 5C5C5C5C 5CDB5CC5 03E4BD44 5C8747C6 27A666E7 17965C3F 5C5C5C5C 5C56D736 B777F60F 8E4E5CBE 5C5C5C5C 5C5CCF2E AF6FEE1E 9F5F5C5C 5C5C5C5C 7B5C5C5C 5C5C5C5C 5C5C5C5C 5C5C5C06 5C8242C3 22A363E2 12935C5C 5C5C5C3A 5C53D233 B272F30A 8B4B5C5C 5C5C5C5C 5C3ACA2B AA6AEB1B 9A5A5C5C 5C5C5C5C 0C8D4DCC 2DAC6CED 1D9C5C5C 5C5C5C5C DC X'0001020314093A7F3A3A3A0B0C0D0E0F' Ebcdic-to-ascii conver- DC X'101112133A0A080018193A3A1C1D1E1F' sion table output by DC X'3A3A1C3A3A0A171B3A3A3A3A3A050607' ETOA in assembler DC X'3A3A163A123A3A043A3A3A6A14153A1A' source language. DC X'203A3A3A3A3A3A3A3A5D3A2E3C282B7C' DC X'263A3A3A3A3A3A3A3A3A21242A293B7E' DC X'2D2F3A3A3A3A3A3A3A3A7C2C255F3E3F' DC X'3A3A3A3A3A3A3A3A3A5B3A2340273D22' DC X'3A6162636465666768693A7C3A3A3A3A' DC X'3A6A6B6C6D6E6F7071723A7D3A3A3A3A' DC X'3A3A737475767778797A3A3A3A3A3A3A' DC X'5E3A3A3A3A3A3A3A3A3A3A3A3A3A3A60' DC X'3A4142434445464748493A3A3A3A3A5C' DC X'3A4A4B4C4D4E4F5051523A3A3A3A3A3A' DC X'3A5C535455565758595A3A3A3A3A3A3A' DC X'303132333435363738393A3A3A3A3A3A' =============================================================================== * TCAM - check ATOE & ETOA for invertibility * Glenn E. Thobe/ 7 JUL 85 * 6701 De Soto Av. #135/ Canoga Park, CA 91303 * IVA3GET@UCLAMVS (BITNET) implicit integer (a - z) dimension atoe(0:127), etoa(0:255) character*20 msg read (9, 1000) atoe, etoa 1000 format (' DC X''', 16z2.2, '''') do 100 i = 0, 127 j = atoe(i) k = etoa(j) if (i .eq. k) then msg = ' ' else msg = ' no match' endif write (*, 2000) i, j, k, i, j, k, msg write (10, 2000) i, j, k, i, j, k, msg 2000 format (3i4, 3z4.2, a) 100 continue end /* This table is taken straight from the TSO-Kermit distribution source. It is both input and output to the program TCAM */ ATOE DC X'00010203372D2E2F1605250B0C0D0E0F' TSO25360 DC X'101112133C3D322618193F271C1D1E1F' TSO25370 DC X'405A7F7B5B6C507D4D5D5C4E6B604B61' TSO25380 DC X'F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F' TSO25390 DC X'7CC1C2C3C4C5C6C7C8C9D1D2D3D4D5D6' TSO25400 DC X'D7D8D9E2E3E4E5E6E7E8E9ADE0BD5F6D' TSO25410 DC X'79818283848586878889919293949596' TSO25420 DC X'979899A2A3A4A5A6A7A8A9C04FD0A107' TSO25430 ETOA DC X'000102030009007F0000000B0C0D0E0F' TSO25460 DC X'10111213000D0800181900001C1D1E1F' TSO25480 DC X'00000000000A171B0000000000050607' TSO25490 DC X'0000160000000004000000001415001A' TSO25500 DC X'20000000000000000000002E3C282B7C' TSO25510 DC X'2600000000000000000021242A293B5E' TSO25520 DC X'2D2F00000000000000007C2C255F3E3F' TSO25530 DC X'000000000000000000603A2340273D22' TSO25540 DC X'00616263646566676869007B00000000' TSO25550 DC X'006A6B6C6D6E6F707172007D00000000' TSO25560 DC X'007E737475767778797A0000005B0000' TSO25570 DC X'000000000000000000000000005D0000' TSO25580 DC X'7B414243444546474849000000000000' TSO25590 DC X'7D4A4B4C4D4E4F505152000000000000' TSO25600 DC X'5C00535455565758595A000000000000' TSO25610 DC X'303132333435363738397C0000000000' TSO25620 ascii --> ebcdic --> ascii Program TCAM output for TSO-Kermit distribution. 0 0 0 00 00 00 Note that the two mappings are inverses of 1 1 1 01 01 01 one another for the entire ASCII character 2 2 2 02 02 02 set, not only for the so-called printable 3 3 3 03 03 03 subset 32-127. 4 55 4 04 37 04 5 45 5 05 2D 05 6 46 6 06 2E 06 7 47 7 07 2F 07 8 22 8 08 16 08 9 5 9 09 05 09 10 37 10 0A 25 0A 11 11 11 0B 0B 0B 12 12 12 0C 0C 0C 13 13 13 0D 0D 0D 14 14 14 0E 0E 0E 15 15 15 0F 0F 0F 16 16 16 10 10 10 17 17 17 11 11 11 18 18 18 12 12 12 19 19 19 13 13 13 20 60 20 14 3C 14 21 61 21 15 3D 15 22 50 22 16 32 16 23 38 23 17 26 17 24 24 24 18 18 18 25 25 25 19 19 19 26 63 26 1A 3F 1A 27 39 27 1B 27 1B 28 28 28 1C 1C 1C 29 29 29 1D 1D 1D 30 30 30 1E 1E 1E 31 31 31 1F 1F 1F 32 64 32 20 40 20 33 90 33 21 5A 21 34 127 34 22 7F 22 35 123 35 23 7B 23 36 91 36 24 5B 24 37 108 37 25 6C 25 38 80 38 26 50 26 39 125 39 27 7D 27 40 77 40 28 4D 28 41 93 41 29 5D 29 42 92 42 2A 5C 2A 43 78 43 2B 4E 2B 44 107 44 2C 6B 2C 45 96 45 2D 60 2D 46 75 46 2E 4B 2E 47 97 47 2F 61 2F 48 240 48 30 F0 30 49 241 49 31 F1 31 50 242 50 32 F2 32 51 243 51 33 F3 33 52 244 52 34 F4 34 53 245 53 35 F5 35 54 246 54 36 F6 36 55 247 55 37 F7 37 56 248 56 38 F8 38 57 249 57 39 F9 39 58 122 58 3A 7A 3A 59 94 59 3B 5E 3B 60 76 60 3C 4C 3C 61 126 61 3D 7E 3D 62 110 62 3E 6E 3E 63 111 63 3F 6F 3F 64 124 64 40 7C 40 65 193 65 41 C1 41 66 194 66 42 C2 42 67 195 67 43 C3 43 68 196 68 44 C4 44 69 197 69 45 C5 45 70 198 70 46 C6 46 71 199 71 47 C7 47 72 200 72 48 C8 48 73 201 73 49 C9 49 74 209 74 4A D1 4A 75 210 75 4B D2 4B 76 211 76 4C D3 4C 77 212 77 4D D4 4D 78 213 78 4E D5 4E 79 214 79 4F D6 4F 80 215 80 50 D7 50 81 216 81 51 D8 51 82 217 82 52 D9 52 83 226 83 53 E2 53 84 227 84 54 E3 54 85 228 85 55 E4 55 86 229 86 56 E5 56 87 230 87 57 E6 57 88 231 88 58 E7 58 89 232 89 59 E8 59 90 233 90 5A E9 5A 91 173 91 5B AD 5B 92 224 92 5C E0 5C 93 189 93 5D BD 5D 94 95 94 5E 5F 5E 95 109 95 5F 6D 5F 96 121 96 60 79 60 97 129 97 61 81 61 98 130 98 62 82 62 99 131 99 63 83 63 100 132 100 64 84 64 101 133 101 65 85 65 102 134 102 66 86 66 103 135 103 67 87 67 104 136 104 68 88 68 105 137 105 69 89 69 106 145 106 6A 91 6A 107 146 107 6B 92 6B 108 147 108 6C 93 6C 109 148 109 6D 94 6D 110 149 110 6E 95 6E 111 150 111 6F 96 6F 112 151 112 70 97 70 113 152 113 71 98 71 114 153 114 72 99 72 115 162 115 73 A2 73 116 163 116 74 A3 74 117 164 117 75 A4 75 118 165 118 76 A5 76 119 166 119 77 A6 77 120 167 120 78 A7 78 121 168 121 79 A8 79 122 169 122 7A A9 7A 123 192 123 7B C0 7B 124 79 124 7C 4F 7C 125 208 125 7D D0 7D 126 161 126 7E A1 7E 127 7 127 7F 07 7F /* These tables were generated from the non-standard TCAM tables used at Litton Computer Services by the above programs ATOE and ETOA. */ ATOE DC X'3F3F3F3F372D3F2F6D05150B0C370E0F' This is both input & DC X'3F113437043F3F3F183F3F3F3F3F3F3F' output to the program DC X'405A7F7B5B6C507D4D5D5C4E6B604B61' TCAM. DC X'F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F' DC X'7CC1C2C3C4C5C6C7C8C9D1D2D3D4D5D6' DC X'D7D8D9E2E3E4E5E6E7E8E979CF494F6D' DC X'3F818283848586878889919293949596' DC X'979899A2A3A4A5A6A7A8A93F3F3F3F07' ETOA DC X'0001020314093A7F3A3A3A0B0C0D0E0F' DC X'101112133A0A080018193A3A1C1D1E1F' DC X'3A3A1C3A3A0A171B3A3A3A3A3A050607' DC X'3A3A163A123A3A043A3A3A6A14153A1A' DC X'203A3A3A3A3A3A3A3A5D3A2E3C282B7C' DC X'263A3A3A3A3A3A3A3A3A21242A293B7E' DC X'2D2F3A3A3A3A3A3A3A3A7C2C255F3E3F' DC X'3A3A3A3A3A3A3A3A3A5B3A2340273D22' DC X'3A6162636465666768693A7C3A3A3A3A' DC X'3A6A6B6C6D6E6F7071723A7D3A3A3A3A' DC X'3A3A737475767778797A3A3A3A3A3A3A' DC X'5E3A3A3A3A3A3A3A3A3A3A3A3A3A3A60' DC X'3A4142434445464748493A3A3A3A3A5C' DC X'3A4A4B4C4D4E4F5051523A3A3A3A3A3A' DC X'3A5C535455565758595A3A3A3A3A3A3A' DC X'303132333435363738393A3A3A3A3A3A' ascii --> ebcdic --> ascii Program output for LCS's nonstandard TCAM. 0 63 26 00 3F 1A no match Note the failure of the e-to-a 1 63 26 01 3F 1A no match transformation to recover the 2 63 26 02 3F 1A no match original ascii characters. 3 63 26 03 3F 1A no match There is no way Kermit would 4 55 4 04 37 04 work with these TCAM tables. 5 45 5 05 2D 05 Not only is SOH swallowed (ascii 0) 6 63 26 06 3F 1A no match but several printable ascii 7 47 7 07 2F 07 characters map to the same ebcdic 8 109 95 08 6D 5F no match code. 9 5 9 09 05 09 10 21 10 0A 15 0A 11 11 11 0B 0B 0B 12 12 12 0C 0C 0C 13 55 4 0D 37 04 no match 14 14 14 0E 0E 0E 15 15 15 0F 0F 0F 16 63 26 10 3F 1A no match 17 17 17 11 11 11 18 52 18 12 34 12 19 55 4 13 37 04 no match 20 4 20 14 04 14 21 63 26 15 3F 1A no match 22 63 26 16 3F 1A no match 23 63 26 17 3F 1A no match 24 24 24 18 18 18 25 63 26 19 3F 1A no match 26 63 26 1A 3F 1A 27 63 26 1B 3F 1A no match 28 63 26 1C 3F 1A no match 29 63 26 1D 3F 1A no match 30 63 26 1E 3F 1A no match 31 63 26 1F 3F 1A no match 32 64 32 20 40 20 33 90 33 21 5A 21 34 127 34 22 7F 22 35 123 35 23 7B 23 36 91 36 24 5B 24 37 108 37 25 6C 25 38 80 38 26 50 26 39 125 39 27 7D 27 40 77 40 28 4D 28 41 93 41 29 5D 29 42 92 42 2A 5C 2A 43 78 43 2B 4E 2B 44 107 44 2C 6B 2C 45 96 45 2D 60 2D 46 75 46 2E 4B 2E 47 97 47 2F 61 2F 48 240 48 30 F0 30 49 241 49 31 F1 31 50 242 50 32 F2 32 51 243 51 33 F3 33 52 244 52 34 F4 34 53 245 53 35 F5 35 54 246 54 36 F6 36 55 247 55 37 F7 37 56 248 56 38 F8 38 57 249 57 39 F9 39 58 122 58 3A 7A 3A 59 94 59 3B 5E 3B 60 76 60 3C 4C 3C 61 126 61 3D 7E 3D 62 110 62 3E 6E 3E 63 111 63 3F 6F 3F 64 124 64 40 7C 40 65 193 65 41 C1 41 66 194 66 42 C2 42 67 195 67 43 C3 43 68 196 68 44 C4 44 69 197 69 45 C5 45 70 198 70 46 C6 46 71 199 71 47 C7 47 72 200 72 48 C8 48 73 201 73 49 C9 49 74 209 74 4A D1 4A 75 210 75 4B D2 4B 76 211 76 4C D3 4C 77 212 77 4D D4 4D 78 213 78 4E D5 4E 79 214 79 4F D6 4F 80 215 80 50 D7 50 81 216 81 51 D8 51 82 217 82 52 D9 52 83 226 83 53 E2 53 84 227 84 54 E3 54 85 228 85 55 E4 55 86 229 86 56 E5 56 87 230 87 57 E6 57 88 231 88 58 E7 58 89 232 89 59 E8 59 90 233 90 5A E9 5A 91 121 91 5B 79 5B 92 207 92 5C CF 5C 93 73 93 5D 49 5D 94 79 124 5E 4F 7C no match 95 109 95 5F 6D 5F 96 63 26 60 3F 1A no match 97 129 97 61 81 61 98 130 98 62 82 62 99 131 99 63 83 63 100 132 100 64 84 64 101 133 101 65 85 65 102 134 102 66 86 66 103 135 103 67 87 67 104 136 104 68 88 68 105 137 105 69 89 69 106 145 106 6A 91 6A 107 146 107 6B 92 6B 108 147 108 6C 93 6C 109 148 109 6D 94 6D 110 149 110 6E 95 6E 111 150 111 6F 96 6F 112 151 112 70 97 70 113 152 113 71 98 71 114 153 114 72 99 72 115 162 115 73 A2 73 116 163 116 74 A3 74 117 164 117 75 A4 75 118 165 118 76 A5 76 119 166 119 77 A6 77 120 167 120 78 A7 78 121 168 121 79 A8 79 122 169 122 7A A9 7A 123 63 26 7B 3F 1A no match 124 63 26 7C 3F 1A no match 125 63 26 7D 3F 1A no match 126 63 26 7E 3F 1A no match 127 7 127 7F 07 7F -------