Totzkeeeeee's Blog

Just because I can...

  Home  |   Contact  |   Syndication    |   Login
  216 Posts | 4 Stories | 345 Comments | 321 Trackbacks


My blog is worth $14,678.04.
How much is your blog worth?

Tag Cloud


Post Categories

Blog Roll

Cool Sites

Think you've got it bad?  Having a little trouble getting a couple of different systems to talk to each other?  Take heart.  It could be a lot worse:

Newsgroups: comp.terminals
Subject: Re: IBM 3270 specifications

|> I am trying to get information about the IBM 3270
|> terminal emulation. I would need some specifications
|> about how 3270-terminals are addressed by the host.
|> If anyone's got some info, please send me some
|> pointers, as I could not find any info (FAQs, ...).

Start with getting the "IBM 3270 Information Display System Data Stream
Programmer's Reference," catalog number GA23-0059.  It should be about

If you think you're just going to bang out an emulation like you might
for VT100 ....   Whew, do you have a surprise coming!  ;-}

The surprise of which he speaks is the fact that the IBM 3270 speaks EBCDIC and is a block-oriented terminal.  Editing happens locally and very few keys actually put information on the wire. Telnet based terminals (i.e. VT100) for talking to UNIX are character-based.  Every key-stroke sends a character across the wire to the server. 

The astute among you will no doubt see how this could present certain “opportunities for personal growth” as I like to call them. 

To complicate things even further the translation of EBCDIC to ASCII isn't really straight forward.  With ASCII, the alphabet - both upper and lower case are mapped to a continuous sequence of numbers.  Upper case A-Z run from 65 to 90 and lower case from 97 to 122.

EBCDIC uppercase characters occupy three non-contiguous ranges - 0xC1 to 0xC9, 0xD1 to 0xD9, and 0xE2 to 0xE9. Lowercase have their own ranges at 0x81 to 0x89, 0x91 to 0x99, 0xA2 to 0xA9.  This makes mapping a little messy. 

ASCII “A“ = 65 and EBCDIC “A“ = 0xC1 (193 dec) which makes the offset 128.

You can do 65 + 128 to get an EBCDIC “A“ and 73 + 128 to get an “I“ but not 74 + 128 to get a “J“.  It's not a huge deal; it just adds one more “opportunity” for that growth of which I spoke earlier.

So, next time you're feeling a little hard-done-by, you can take heart that it's not as bad as it used to be.  If you do still have to deal with stuff like this, you may find this resource helpful.

Just because I can...


posted on Thursday, October 27, 2005 9:41 AM