ASCII Conversion Chart

About This Chart

This is my reconstruction of a chart that I used while teaching microprocessor programming.   It is derived from a chart that I believe came from the Heathkit Company possibly with their solderless breadboards or with an early 'Hero' robot.   My only surviving copy is in pretty bad shape so I generated this version and added the 'Binary' information which wasn't on the original.

Here is the Chart:




Download the Chart

PDF Document
This is the best choice if you want to print a copy.

Word Document
This is the best choice if you want to modify or add to the document.

Here is some interesting information that you can derive from this chart.

The first section:

The left hand section contains the first 32 codes, those with hex values 00 through 1F, which are known as the 'non-printing' characters.   These codes were used to supervise or to 'control' the data flow and the machines (typically Teletype machines) used to send and receive that data.   When mechanical Teletype machines evolved into CRT terminals these codes were adapted to those terminals.   They were invoked by using the control key [Ctrl] along with one of the letter keys.   Which letter key you ask?   Well look to the right to column 3 or 4 on the same line as the code you are interested and you will find the correct letter.   Dig out your old ADM-3 terminal and try some out.   The values in the column labeled "ASCII" in this section are abbreviations for the action that the code would cause.   Code 07h is labeled BEL and it would ring the bell (to wake up the operator) on a Teletype or sound a 'beep' on the CRT terminal.   So [Ctrl + G] or [Ctrl + g] will cause your dumb terminal to emit a beep.   If you look at the raw contents of a text document (one produced by Notepad for example) you will see that each line ends with the hex codes 0D and 0A in that order.   From this sheet you can see that these refer to CR and LF.   This tells the CRT terminal to move the cursor back the start of the line (CR) and then advance to the next line (LF).   Other programs on other operating systems put the LF before the CR or just use the CR and imply the LF.   So much for standards.   BS stands for 'backspace', HT is 'horizontal tab', FF is 'form feed'.   This one is really neat, on a mechanical machine it advanced to the next 'form' or next sheet of paper.   On a CRT terminal it sent a bunch of linefeeds, effectively clearing the screen.   One operating system we used had the capability of sending messages from one user to another.   These messages normally were restricted to the bottom line of the screen, but if you sent your (former) friend a message with an FF (or a bunch of LFs) it cleared the screen thus sending whatever he was working on into oblivion.   Check out Wikipedia for more information on ASCII codes.

The second section:

The next section contains 32 more codes, those with hex values 20 through 3F.   These are the first of the printable characters and they consist mostly of punctuation but they also contain the numbers 0 through 9.   Notice how the ASCII code (hex) for a number relates to the number itself.   This is what makes it so easy to convert numbers to and from ASCII.   If you have the ASCII code for a number you can either subtract 30h or mask off the upper four bits and you will be left with the number itself.   Likewise you can generate the ASCII code from the number by adding 30h or by ORing with 30h.   Try to visualize what is happening while using the decimal version of the ASCII code and you will soon see why I am using hex.   Don't those forms that want your credit card number without spaces or dashes infuriate you.   If they haven't in the past then they should now, since you can see that it is a sign of incredibly lazy programming.   All the program has to do to get rid of spaces, dashes, and anything else except numbers, is to ignore any value less than 30h or greater than 39h, which can typically be achieved with only a few lines of code.

The third and fourth sections:

These sections contains the rest of the ASCII codes, those with hex values 40 through 7F.   Here is where you find the alphabetic characters and some more punctuation.   Compare the binary value for an uppercase letter with the value for it's lowercase equivalent and you will see that the only difference is in bit 5. (Remember, the bits are numbered 7 6 5 4 3 2 1 0.)   The uppercase letters have bit 5 = '0' and the lowercase letters have bit 5 = '1'.   So, when you enter your name into a form using lowercase and the screen shows all uppercase letters all they are doing is ANDing your input with 11011111b before displaying it.

The very last entry - DEL:

This is best explained by an example.   Let's assume that you entered an 'a' (binary code 01100001) when you really wanted an 'A' (binary code 01000001).   It is no problem to correct this on a CRT screen, just back up the cursor (with a backspace code - BS), and replace the 'a' with an 'A'.   This is a big problem on a machine that punches the code into a paper tape since a '1' is represented by a hole in the tape.   The machine can't back up and fill in the hole but it can back up and punch out all of the holes.   The replacement character is then punched in the next position.   When the paper tape reader encounters a DEL it just ignores it and procedes to the next position where it finds the replacement character.   Did you notice that I said that it punches out all of the holes?   The actual ASCII code is a 7 bit code and we are using that code on an 8 bit system, which is why the high bit is '0' for all of the entries on this chart.   So, as far as the paper tape machine is concerned, all of the bits that it knows about are '1' for a DEL code.

Where's the € symbol?

This is ASCII, that would require unASCII.
(my humble attempt at humor)