1 /* $NetBSD: asc_ebc.c,v 1.6 2002/09/15 01:27:44 thorpej Exp $ */
4 * Copyright (c) 1988 The Regents of the University of California.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 #include <sys/cdefs.h>
34 #if defined(__RCSID) && !defined(lint)
36 static char sccsid
[] = "@(#)asc_ebc.c 4.2 (Berkeley) 4/26/91";
38 __RCSID("$NetBSD: asc_ebc.c,v 1.6 2002/09/15 01:27:44 thorpej Exp $");
41 #endif /* ! HOST_TOOL */
44 * Ascii<->Ebcdic translation tables.
49 unsigned char asc_ebc
[NASCII
] = {
51 /* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 /* 08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53 /* 10 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
54 /* 18 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55 /* 20 */ 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,
56 /* 28 */ 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
57 /* 30 */ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
58 /* 38 */ 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
59 /* 40 */ 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
60 /* 48 */ 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
61 /* 50 */ 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
62 /* 58 */ 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,
63 /* 60 */ 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
64 /* 68 */ 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
65 /* 70 */ 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
66 /* 78 */ 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x00,
71 * ebcdic to ascii translation tables
74 unsigned char ebc_asc
[NEBC
] = {
75 /* 00 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
76 /* 08 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
77 /* 10 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
78 /* 18 */ ' ', ' ', ' ', ' ', '*', ' ', ';', ' ',
79 /* 20 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
80 /* 28 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
81 /* 30 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
82 /* 38 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
83 /* 40 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
88 #else /* !defined(MSDOS) */
89 /* 4A */ '\233', /* PC cent sign */
90 #endif /* !defined(MSDOS) */
91 /* 4B */ '.', '<', '(', '+', '|',
93 /* 50 */ '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
94 /* 58 */ ' ', ' ', '!', '$', '*', ')', ';', '^',
95 /* 60 */ '-', '/', ' ', ' ', ' ', ' ', ' ', ' ',
96 /* 68 */ ' ', ' ', '|', ',', '%', '_', '>', '?',
97 /* 70 */ ' ', '^', ' ', ' ', ' ', ' ', ' ', ' ',
98 /* 78 */ ' ', '`', ':', '#', '@', '\'', '=', '"',
99 /* 80 */ ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
100 /* 88 */ 'h', 'i', ' ', ' ', ' ', ' ', ' ', ' ',
101 /* 90 */ ' ', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
102 /* 98 */ 'q', 'r', ' ', ' ', ' ', ' ', ' ', ' ',
103 /* A0 */ ' ', '~', 's', 't', 'u', 'v', 'w', 'x',
104 /* A8 */ 'y', 'z', ' ', ' ', ' ', '[', ' ', ' ',
105 /* B0 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
106 /* B8 */ ' ', ' ', ' ', ' ', ' ', ']', ' ', ' ',
107 /* C0 */ '{', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
108 /* C8 */ 'H', 'I', ' ', ' ', ' ', ' ', ' ', ' ',
109 /* D0 */ '}', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
110 /* D8 */ 'Q', 'R', ' ', ' ', ' ', ' ', ' ', ' ',
111 /* E0 */ '\\', ' ', 'S', 'T', 'U', 'V', 'W', 'X',
112 /* E8 */ 'Y', 'Z', ' ', ' ', ' ', ' ', ' ', ' ',
113 /* F0 */ '0', '1', '2', '3', '4', '5', '6', '7',
114 /* F8 */ '8', '9', ' ', ' ', ' ', ' ', ' ', ' ',