EBCDIC

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Guy Harris (talk | contribs) at 23:16, 13 November 2019 (→‎History: And more.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

EBCDIC encoding family
Classification8-bit basic Latin encodings (non‑ASCII)
Preceded byBCD

Extended Binary Coded Decimal Interchange Code[1] (EBCDIC;[1] /ˈɛbsɪdɪk/) is an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding six-bit binary-coded decimal code used with most of IBM's computer peripherals of the late 1950s and early 1960s.[2] It is supported by various non-IBM platforms, such as Fujitsu-Siemens' BS2000/OSD, OS-IV, MSP, and MSP-EX, the SDS Sigma series, Unisys VS/9, Burroughs MCP and ICL VME.

History

Punched card with the Hollerith encoding of the 1964 EBCDIC character set. Contrast at top enhanced to show the printed characters.

EBCDIC was devised in 1963 and 1964 by IBM and was announced with the release of the IBM System/360 line of mainframe computers. It is an eight-bit character encoding, developed separately from the seven-bit ASCII encoding scheme. It was created to extend the existing Binary-Coded Decimal (BCD) Interchange Code, or BCDIC, which itself was devised as an efficient means of encoding the two zone and number punches on punched cards into six bits. The distinct encoding of 's' and 'S' (using position 2 instead of 1) was maintained from punched cards where it was desirable not to have hole punches too close to each other to ensure the integrity of the physical card.

While IBM was a chief proponent of the ASCII standardization committee,[3] the company did not have time to prepare ASCII peripherals (such as card punch machines) to ship with its System/360 computers, so the company settled on EBCDIC.[2] The System/360 became wildly successful, together with clones such as RCA Spectra 70, ICL System 4, and Fujitsu FACOM, thus so did EBCDIC.

All IBM mainframe and midrange peripherals and operating systems use EBCDIC as their inherent encoding[4] (with toleration for ASCII, for example, ISPF in z/OS can browse and edit both EBCDIC and ASCII encoded files). Software and many hardware peripherals can translate to and from encodings, and modern mainframes (such as IBM Z) include processor instructions, at the hardware level, to accelerate translation between character sets.

There is an EBCDIC-oriented Unicode Transformation Format called UTF-EBCDIC proposed by the Unicode consortium, designed to allow easy updating of EBCDIC software to handle Unicode, but not intended to be used in open interchange environments. Even on systems with extensive EBCDIC support, it has not been popular. For example, z/OS supports Unicode (preferring UTF-16 specifically), but z/OS only has limited support for UTF-EBCDIC.

IBM AIX running on the RS/6000 and its descendants including the IBM Power Systems, Linux running on IBM Z, and operating systems running on the IBM PC and its descendants use ASCII, as did AIX/370 and AIX/390 running on System/370 and System/390 mainframes.

Compatibility with ASCII

The fact that all the code points were different was less of a problem for inter-operating with ASCII than the fact that sorting EBCDIC put lowercase letters before uppercase letters and letters before numbers, exactly the opposite of ASCII.

Programming languages and file formats and network protocols designed for ASCII quickly made use of available punctuation marks (such as the curly braces '{ ' and  ' }' ) that did not exist in EBCDIC, making translation to EBCDIC ambiguous (this also prevented various attempts to make internationalized versions of ASCII which also replaced these punctuation marks with letters).

The gaps between letters made simple code that worked in ASCII fail on EBCDIC. For example, "for (c='A';c<='Z';++c)" would set c to the 26 letters in the ASCII alphabet, but 41 characters including a number of unassigned ones in EBCDIC. Fixing this required complicating the code with function calls which was greatly resisted by programmers.

By using all eight bits EBCDIC may have encouraged the use of the eight-bit byte by IBM, while ASCII was more likely to be adopted by systems with 36 bits (as five seven-bit ASCII characters fit into one word).

As eight-bit bytes became widespread, ASCII systems sometimes used the "unused" bit for other purposes, such as metacharacters to mark the borders of records or words. This made it difficult to change the code to work with EBCDIC. On the PDP-11 bytes with the high bit set were treated as negative numbers, behavior that was copied to C, causing unexpected problems with EBCDIC. Both of these problems also hindered the adoption of extended ASCII character sets.

Code page layout

The table below shows the "invariant subset"[5] of EBCDIC, which are characters that should have the same assignments on all EBCDIC code pages. It also shows (in gray) missing ASCII and EBCDIC punctuation, located where they are in CCSID 037 (one of the code page variants of EBCDIC). Unassigned codes are typically filled with international or region-specific characters in the various EBCDIC code page variants, but the characters in gray are often moved around or swapped as well.

In each table cell below, the first row is an abbreviation for a control code or (for printable characters) the character itself; and the second row is the Unicode code (blank for controls that don't exist in Unicode).

EBCDIC
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
0_ Template:Chset-color-ctrl|NUL
0000
Template:Chset-color-ctrl|SOH
0001
Template:Chset-color-ctrl|STX
0002
Template:Chset-color-ctrl|ETX
0003
Template:Chset-color-ctrl|SEL
 
Template:Chset-color-ctrl|HT
0009
Template:Chset-color-ctrl|RNL
 
Template:Chset-color-ctrl|DEL
007F
Template:Chset-color-ctrl|GE
 
Template:Chset-color-ctrl|SPS
 
Template:Chset-color-ctrl|RPT
 
Template:Chset-color-ctrl|VT
000B
Template:Chset-color-ctrl|FF
000C
Template:Chset-color-ctrl|CR
000D
Template:Chset-color-ctrl|SO
000E
Template:Chset-color-ctrl|SI
000F
1_ Template:Chset-color-ctrl|DLE
0010
Template:Chset-color-ctrl|DC1
0011
Template:Chset-color-ctrl|DC2
0012
Template:Chset-color-ctrl|DC3
0013
Template:Chset-color-ctrl|res/enp
 
Template:Chset-color-ctrl|NL
0085
Template:Chset-color-ctrl|BS
0008
Template:Chset-color-ctrl|POC
 
Template:Chset-color-ctrl|CAN
0018
Template:Chset-color-ctrl|EM
0019
Template:Chset-color-ctrl|UBS
 
Template:Chset-color-ctrl|CU1
 
Template:Chset-color-ctrl|IFS
001C
Template:Chset-color-ctrl|IGS
001D
Template:Chset-color-ctrl|IRS
001E
Template:Chset-color-ctrl|ius/itb
001F
2_ Template:Chset-color-ctrl|DS
 
Template:Chset-color-ctrl|SOS
 
Template:Chset-color-ctrl|FS
 
Template:Chset-color-ctrl|WUS
 
Template:Chset-color-ctrl|byp/inp
 
Template:Chset-color-ctrl|LF
000A
Template:Chset-color-ctrl|ETB
0017
Template:Chset-color-ctrl|ESC
001B
Template:Chset-color-ctrl|SA
 
Template:Chset-color-ctrl|SFE
 
Template:Chset-color-ctrl|sm/sw
 
Template:Chset-color-ctrl|CSP
 
Template:Chset-color-ctrl|MFA
 
Template:Chset-color-ctrl|ENQ
0005
Template:Chset-color-ctrl|ACK
0006
Template:Chset-color-ctrl|BEL
0007
3_ Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-ctrl|SYN
0016
Template:Chset-color-ctrl|IR
 
Template:Chset-color-ctrl|PP
 
Template:Chset-color-ctrl|TRN
 
Template:Chset-color-ctrl|NBS
 
Template:Chset-color-ctrl|EOT
0004
Template:Chset-color-ctrl|SBS
 
Template:Chset-color-ctrl|IT
 
Template:Chset-color-ctrl|RFF
 
Template:Chset-color-ctrl|CU3
 
Template:Chset-color-ctrl|DC4
0014
Template:Chset-color-ctrl|NAK
0015
Template:Chset-color-undef| Template:Chset-color-ctrl|SUB
001A
4_ Template:Chset-color-misc|SP
0020
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|¢
00A2
Template:Chset-color-punct|.
002E
Template:Chset-color-graph|<
003C
Template:Chset-color-punct|(
0028
Template:Chset-color-graph|+
002B
Template:Chset-color-undef||
007C
5_ Template:Chset-color-punct|&
0026
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|!
0021
Template:Chset-color-undef|$
0024
Template:Chset-color-punct|*
002A
Template:Chset-color-punct|)
0029
Template:Chset-color-punct|;
003B
Template:Chset-color-undef|¬
00AC
6_ Template:Chset-color-punct|-
002D
Template:Chset-color-punct|/
002F
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|¦
00A6
Template:Chset-color-punct|,
002C
Template:Chset-color-punct|%
0025
Template:Chset-color-punct|_
005F
Template:Chset-color-graph|>
003E
Template:Chset-color-punct|?
003F
7_ Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|`
0060
Template:Chset-color-punct|:
003A
Template:Chset-color-undef|#
0023
Template:Chset-color-undef|@
0040
Template:Chset-color-punct|'
0027
Template:Chset-color-graph|=
003D
Template:Chset-color-punct|"
0022
8_ Template:Chset-color-undef| Template:Chset-color-alpha|a
0061
Template:Chset-color-alpha|b
0062
Template:Chset-color-alpha|c
0063
Template:Chset-color-alpha|d
0064
Template:Chset-color-alpha|e
0065
Template:Chset-color-alpha|f
0066
Template:Chset-color-alpha|g
0067
Template:Chset-color-alpha|h
0068
Template:Chset-color-alpha|i
0069
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|±
00B1
9_ Template:Chset-color-undef| Template:Chset-color-alpha|j
006A
Template:Chset-color-alpha|k
006B
Template:Chset-color-alpha|l
006C
Template:Chset-color-alpha|m
006D
Template:Chset-color-alpha|n
006E
Template:Chset-color-alpha|o
006F
Template:Chset-color-alpha|p
0070
Template:Chset-color-alpha|q
0071
Template:Chset-color-alpha|r
0072
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|
A_ Template:Chset-color-undef| Template:Chset-color-undef|~
007E
Template:Chset-color-alpha|s
0073
Template:Chset-color-alpha|t
0074
Template:Chset-color-alpha|u
0075
Template:Chset-color-alpha|v
0076
Template:Chset-color-alpha|w
0077
Template:Chset-color-alpha|x
0078
Template:Chset-color-alpha|y
0079
Template:Chset-color-alpha|z
007A
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|
B_ Template:Chset-color-undef|^
005E
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|[
005B
Template:Chset-color-undef|]
005D
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|
C_ Template:Chset-color-undef|{
007B
Template:Chset-color-alpha|A
0041
Template:Chset-color-alpha|B
0042
Template:Chset-color-alpha|C
0043
Template:Chset-color-alpha|D
0044
Template:Chset-color-alpha|E
0045
Template:Chset-color-alpha|F
0046
Template:Chset-color-alpha|G
0047
Template:Chset-color-alpha|H
0048
Template:Chset-color-alpha|I
0049
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|
D_ Template:Chset-color-undef|}
007D
Template:Chset-color-alpha|J
004A
Template:Chset-color-alpha|K
004B
Template:Chset-color-alpha|L
004C
Template:Chset-color-alpha|M
004D
Template:Chset-color-alpha|N
004E
Template:Chset-color-alpha|O
004F
Template:Chset-color-alpha|P
0050
Template:Chset-color-alpha|Q
0051
Template:Chset-color-alpha|R
0052
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|
E_ Template:Chset-color-undef|\
005C
Template:Chset-color-undef| Template:Chset-color-alpha|S
0053
Template:Chset-color-alpha|T
0054
Template:Chset-color-alpha|U
0055
Template:Chset-color-alpha|V
0056
Template:Chset-color-alpha|W
0057
Template:Chset-color-alpha|X
0058
Template:Chset-color-alpha|Y
0059
Template:Chset-color-alpha|Z
005A
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef|
F_ Template:Chset-color-digit|0
0030
Template:Chset-color-digit|1
0031
Template:Chset-color-digit|2
0032
Template:Chset-color-digit|3
0033
Template:Chset-color-digit|4
0034
Template:Chset-color-digit|5
0035
Template:Chset-color-digit|6
0036
Template:Chset-color-digit|7
0037
Template:Chset-color-digit|8
0038
Template:Chset-color-digit|9
0039
Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-undef| Template:Chset-color-ctrl|EO
 

Definitions of non-Unicode EBCDIC controls

SEL 0004 Device-specific control character
RNL 0006 Required newline and resets Indent Tab mode
GE 0008 Non-locking shift that changes the interpretation of the following character
SPS 0009 Begin superscript or undo subscript
RPT 000A Repeat, device-specific character string repeat order
RES/ENP 0014 Restore/Enable Presentation, "terminates the Bypass/Inhibit Presentation mode of operation and activates associated printers or displays"
POC 0017 Program Operator Communication. Followed by two one-byte operators that identify the specific function, for example a light or function key
UBS 001A Unit backspace a fractional space
CU1 001B Customer use, not used by IBM
IUS/ITB 001F Interchange Unit Separator, Intermediate Transmission Block. Terminates an information block called a UNIT.
DS 0020 Digit Select, used by S/360 edit (ED) instruction
SOS 0021 Start of Significance, used by S/360 edit (ED) instruction
WUS 0023 Word Underscore, underscores the immediately preceding word
BYP/INP 0024 Bypass/Inhibit Presentation, terminates RES/ENP mode
SA 0028 Set Attribute, marks the beginning of a fixed-length device specific control sequence (deprecated)
SFE 0029 Start Field Extended, marks the beginning of a variable-length device specific control sequence (deprecated)
SM/SW 002A Set Mode/Switch, device specific control that sets a mode of operation
CSP 002B Control Sequence Prefix, marks the beginning of a variable-length device specific control sequence
MFA 002C Modify Field Attribute, marks the beginning of a variable-length device specific control sequence (deprecated)
0030 Reserved for future use by IBM
0031 Reserved for future use by IBM
IR 0033 Index Return, Move to start of next line or terminate an information unit
PP 0034 Presentation Position, followed by two one-byte parameters to set the current position
TRN 0035 Transparent, followed by one byte parameter that indicates the number of bytes of transparent data that follow
NBS 0036 Numeric Backspace, move backwards the width of one digit
SBS 0038 Subscript, begin subscript or undo superscript
IT 0039 Indent Tab, indents the current and all following lines, reset by RNL or RFF
RFF 003A Required Formfeed and reset Indent Tab mode
CU3 003B Customer use, not used by IBM
003E Reserved for future use by IBM
EO 00FF All ones character used as filler

[6]

Criticism and humor

Open-source software advocate and software developer Eric S. Raymond writes in his Jargon File that EBCDIC was loathed by hackers, by which he meant[7] members of a subculture of enthusiastic programmers. The Jargon File 4.4.7 gives the following definition:[8]

EBCDIC: /eb´s@·dik/, /eb´see`dik/, /eb´k@·dik/, n. [abbreviation, Extended Binary Coded Decimal Interchange Code] An alleged character set used on IBM dinosaurs. It exists in at least six mutually incompatible versions, all featuring such delights as non-contiguous letter sequences and the absence of several ASCII punctuation characters fairly important for modern computer languages (exactly which characters are absent varies according to which version of EBCDIC you're looking at). IBM adapted EBCDIC from punched card code in the early 1960s and promulgated it as a customer-control tactic (see connector conspiracy), spurning the already established ASCII standard. Today, IBM claims to be an open-systems company, but IBM's own description of the EBCDIC variants and how to convert between them is still internally classified top-secret, burn-before-reading. Hackers blanch at the very name of EBCDIC and consider it a manifestation of purest evil.

— The Jargon file 4.4.7

EBCDIC design was also the source of many jokes. One such joke[citation needed] went:

Professor: "So the American government went to IBM to come up with an encryption standard, and they came up with—"
Student: "EBCDIC!"

References to the EBCDIC character set are made in the classic Infocom adventure game series Zork. In the "Machine Room" in Zork II, EBCDIC is used to imply an incomprehensible language:

This is a large room full of assorted heavy machinery, whirring noisily. The room smells of burned resistors. Along one wall are three buttons which are, respectively, round, triangular, and square. Naturally, above these buttons are instructions written in EBCDIC...

See also

References

  1. ^ a b Mackenzie, Charles E. (1980). Coded Character Sets, History and Development (1 ed.). Addison-Wesley Publishing Company, Inc. ISBN 0-201-14460-3. LCCN 77-90165. ISBN 978-0-201-14460-4. Retrieved 2016-05-22. {{cite book}}: |work= ignored (help) [1]
  2. ^ a b Bemer, Bob. "EBCDIC and the P-Bit (The Biggest Computer Goof Ever) - Computer History Vignettes". Archived from the original on 2018-05-13. Retrieved 2013-07-02. […] but their printers and punches were not ready to handle ASCII, and IBM just HAD to announce.
  3. ^ "X3.4-1963". 1963. p. 4. Archived from the original on 2016-08-12. (NB. IBM had four staff members on the final 21-member ASA X3.2 sub-committee.)
  4. ^ IBMnt (2008). "IBM confirms the use of EBCDIC in their mainframes as a default practice". Archived from the original on 2013-01-03. Retrieved 2008-06-16.
  5. ^ IBM Knowledge Center Invariant charcter set
  6. ^ "Appendix G-1. EBCDIC control character definitions". IBM Globalization. IBM Corporation. Archived from the original on 2018-09-11.
  7. ^ Raymond, Eric S. (1997). "The New Hacker's Dictionary". p. 310.
  8. ^ "EBCDIC". Jargon File. Archived from the original on 2018-05-13. Retrieved 2018-05-13.

External links