Re: to jlliagre
Why are you expecting 0xC1 to display A ?
0xC1 in "ASCII" (actually ISO-LATIN1) is Á.
*********************************
the ebcdic equivalent of 0xc1 is A
and i have to print EBCDIC equivalent Not Ascii equivalent
i changed following array
static unsigned char a2e[256] = {
0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 37, 11, 12, 13, 14, 15,16,
17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,64,
79,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97,30,31,
32,243,244,245,246,247,248,249,122, 94, 76,126,110,111,32,193,194,
195,196,197,198,199,200,201,209,46,60,40,124,214,38,216,217,226,
227,228,229,230,231,232,33, 36,42, 41, 59,109,45,47,130,131,132,133,
134,135,136,137,145,44,37,95,62,63,151,152,153,162,163,164,165,166,
167,168,58,35,64,39,61, 34,32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 1,
43, 44, 9, 10, 27,48, 106, 107, 108, 109, 110, 111, 112, 113, 114, 58, 59,
4, 20, 62,225,65, 66, 115, 116, 117, 118, 119, 120, 121, 122, 82, 83, 84, 85,
86, 87,88, 89, 98, 99,100,101,102,103,104,96,112,113,114,115,116,117,118,65,66,
67,68,69,70,71,72,73,144,154,155,156,157,158,159,74,75,76,77,78,79,80,81,82,178,
179,180,181,182,183,184,185,83,84,85,86,87,88,89,90,204,205,206,207,218,219,30,
31,32,33,34,35,36,37,38,39,250,251,252,253,254,255
};
and printed outarr as character
i am getting correct values for alphabets
but not for numerals
i have used following table
Dec Hex ASCII EBCDIC Dec Hex ASCII EBCDIC
---------------------- -----------------------
0 0 NUL NUL 32 20 DS
1 1 SOH SOH 33 21 ! SOS
2 2 STX STX 34 22 " FS
3 3 ETX ETX 35 23 # WUS
4 4 EOT SEL 36 24 $ BYP/INP
5 5 ENQ HT 37 25 % LF
6 6 ACK RNL 38 26 & ETB
7 7 BEL DEL 39 27 ' ESC
8 8 BS GE 40 28 ( SA
9 9 TAB SPS 41 29 ) SFE
10 A LF RPT 42 2A * SM/SW
11 B VT VT 43 2B + CSP
12 C FF FF 44 2C , MFA
13 D CR CR 45 2D - ENQ
14 E SO SO 46 2E . ACK
15 F SI SI 47 2F / BEL
16 10 DLE DLE 48 30 0
17 11 DC1 DC1 49 31 1
18 12 DC2 DC2 50 32 2 SYN
19 13 DC3 DC3 51 33 3 IR
20 14 DC4 RES/ENP 52 34 4 PP
21 15 NAK NL 53 35 5 TRN
22 16 SYN BS 54 36 6 NBS
23 17 ETB POC 55 37 7 EOT
24 18 CAN CAN 56 38 8 SBS
25 19 EM EM 57 39 9 IT
26 1A SUB UBS 58 3A : RFF
27 1B ESC CU1 59 3B ; CU3
28 1C FS IFS 60 3C < DC4
29 1D GS IGS 61 3D = NAK
30 1E RS IRS 62 3E >
31 1F US ITB/IUS 63 3F ? SUB
Dec Hex ASCII EBCDIC Dec Hex ASCII EBCDIC
------------------------ ------------------------
64 40 @ SP 96 60 ` _
65 41 A RSP 97 61 a /
66 42 B 98 62 b
67 43 C 99 63 c
68 44 D 100 64 d
69 45 E 101 65 e
70 46 F 102 66 f
71 47 G 103 67 g
72 48 H 104 68 h
73 49 I 105 69 i
74 4A J 106 6A j |
75 4B K . 107 6B k ,
76 4C L < 108 6C l %
77 4D M ( 109 6D m _
78 4E N + 110 6E n >
79 4F O | 111 6F o ?
80 50 P & 112 70 p
81 51 Q 113 71 q
82 52 R 114 72 r
83 53 S 115 73 s
84 54 T 116 74 t
85 55 U 117 75 u
86 56 V 118 76 v
87 57 W 119 77 w
88 58 X 120 78 x
89 59 Y 121 79 y `
90 5A Z ! 122 7A z :
91 5B [ $ 123 7B { #
92 5C \ * 124 7C | @
93 5D ] ) 125 7D } '
94 5E ^ ; 126 7E ~ =
95 5F _ 127 7F DEL "
Dec Hex ASCII EBCDIC Dec Hex ASCII EBCDIC
------------------------ ------------------------
128 80 160 A0
129 81 a 161 A1
130 82 b 162 A2 s
131 83 c 163 A3 t
132 84 d 164 A4 u
133 85 e 165 A5 v
134 86 f 166 A6 w
135 87 g 167 A7 x
136 88 h 168 A8 y
137 89 i 169 A9 z
138 8A 170 AA
139 8B { 171 AB
140 8C 172 AC
141 8D 173 AD [
142 8E 174 AE
143 8F + 175 AF
144 90 176 B0
145 91 j 177 B1
146 92 k 178 B2
147 93 l 179 B3
148 94 m 180 B4
149 95 n 181 B5
150 96 o 182 B6
151 97 p 183 B7
152 98 q 184 B8
153 99 r 185 B9
154 9A 186 BA
155 9B } 187 BB
156 9C 188 BC
157 9D 189 BD
158 9E 190 BE
159 9F 191 BF
Dec Hex ASCII EBCDIC Dec Hex ASCII EBCDIC
------------------------ ------------------------
192 C0 224 E0
193 C1 A 225 E1
194 C2 B 226 E2 S
195 C3 C 227 E3 T
196 C4 D 228 E4 U
197 C5 E 229 E5 V
198 C6 F 230 E6 W
199 C7 G 231 E7 X
200 C8 H 232 E8 Y
201 C9 I 233 E9 Z
202 CA 234 EA
203 CB 235 EB
204 CC 236 EC
205 CD 237 ED
206 CE 238 EE
207 CF 239 EF
208 D0 240 F0 0
209 D1 J 241 F1 1
210 D2 K 242 F2 2
211 D3 L 243 F3 3
212 D4 M 244 F4 4
213 D5 N 245 F5 5
214 D6 O 246 F6 6
215 D7 P 247 F7 7
216 D8 Q 248 F8 8
217 D9 R 249 F9 9
218 DA 250 FA
219 DB 251 FB
220 DC 252 FC
221 DD 253 FD
222 DE 254 FE
223 DF 255 FF
For 0XC1 EBCDIC Value is A
hence at position 193 of array i have put value = 65
as 0X65 in ascii is A
it works for alphabets
Last edited by junaid.nehvi; 11-25-2008 at 10:02 AM..