# GnuCOBOL EBCDIC/ASCII translation tables
#
# Copyright (C) 2022,2023 Free Software Foundation, Inc.
#  Written by Nicolas Berthier, Simon Sobisch, David Declerck
#
# This file is part of the GnuCOBOL runtime.
#
# The GnuCOBOL runtime is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# GnuCOBOL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with GnuCOBOL.  If not, see <https://www.gnu.org/licenses/>.

# EBCDIC 500 to 8-bit ASCII conversion table (GCOS7)
#
# https://support.bull.com/ols/product/system/gcos7/gcos7-com/g7-dps7000/doc-com/docf/g/47X257TN27-oct2009/47A205UL04.pdf,
# p627. Note one page is missing from this documentation,
# but the full table can be found in the French version.
#
# Note: the only differences with a "plain" EBCDIC 500 to 8-bit ASCII table
# are that EBCDIC 6A (broken bar) is translated to ASCII 7C (vertical bar)
# and EBCDIC BB (vertical bar) is translated to ASCII 1A (subtitution char).
# This seems to be the "usual" way of translating these characters.

00 01 02 03 9C 09 86 7F 97 8D 8E 0B 0C 0D 0E 0F
10 11 12 13 9D 85 08 87 18 19 92 8F 1C 1D 1E 1F
80 81 82 83 84 0A 17 1B 88 89 8A 8B 8C 05 06 07
90 91 16 93 94 95 96 04 98 99 9A 9B 14 15 9E 1A
20 A0 A1 A2 A3 A4 A5 A6 A7 A8 5B 2E 3C 28 2B 21
26 A9 AA AB AC AD AE AF B0 B1 5D 24 2A 29 3B 5E
2D 2F B2 B3 B4 B5 B6 B7 B8 B9 7C 2C 25 5F 3E 3F
BA BB BC BD BE BF C0 C1 C2 60 3A 23 40 27 3D 22
C3 61 62 63 64 65 66 67 68 69 C4 C5 C6 C7 C8 C9
CA 6A 6B 6C 6D 6E 6F 70 71 72 CB CC CD CE CF D0
D1 7E 73 74 75 76 77 78 79 7A D2 D3 D4 D5 D6 D7
D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7
7B 41 42 43 44 45 46 47 48 49 E8 E9 EA EB EC ED
7D 4A 4B 4C 4D 4E 4F 50 51 52 EE EF F0 F1 F2 F3
5C 9F 53 54 55 56 57 58 59 5A F4 F5 F6 F7 F8 F9
30 31 32 33 34 35 36 37 38 39 FA FB FC FD FE FF

# 8-bit ASCII to EBCDIC 500 conversion table (GCOS7)
#
# This translation being symmetric, the table is built from the previous one.
