An oddity exists in the EBCDIC code -- there is a break in the letter codes between 'j' and 'k' and again between 'r' and 's'. A similar break happens in the upper case region. Though the ordering is still in effect, the code for 'k' is not just 1 greater than that for 'j' and there are codes assigned to punctuation in between! This makes programming a bit inconvenient. For example, a C programmer can't just say: if (ch >= 'a' || ch <= 'z') { .... and expect this to work on an IBM mainframe due to the fact that there are other codes in between some of the letters. But like all seemingly irrational features of the world, this one harkens back to a historical consequence of the way the letter codes were arranged on old IBM punch cards. There were only 13 rows on punch cards: 10 for digits and 3 for special codes. When the arrangement of punched holes was translated into binary, the numbers came out to be noncontiguous -- there were gaps in between -- and so the odd holes in the EBCDIC code exist in order that the code can be compatible with ancient keypunches and cards! |