ASCII
Assembly language programming
By xorpd xorpd.net
We will study some standard ways to
represent text as numbers.
So far we have represented in our programs:
◦ Numbers.
◦ Boolean values (Bits).
How can we represent text?
◦ How can we print letters to the console?
◦ How can the computer keep letters in memory?
American Standard Code for Information
Interchange.
Defines numeric values for basic symbols:
◦ The English alphabet. (Capital letters too).
◦ Digits.
◦ Punctuation symbols (!,$,#,…)
◦ Control codes.
Every symbol is of size 7 bits.
Worldwide standard.
Originally created for use on teleprinters.
Built for data communication.
http://commons.wikimedia.org/wiki/File:T100S_teleprinter.jpg
(ArnoldReinhold)
First used commercially at 1963,
◦ As a 7-bit teleprinter code for American Telephone & Telegraph’s TWX
network.
http://commons.wikimedia.org/wiki/File:ASCII-Table.svg
Printable symbols:
◦ Symbols that could be printed to the screen.
◦ Almost all of the interval: 0x20-0x7f.
Control codes:
◦ Most of those are not in use today.
◦ Almost all of the interval: 0x0-0x1f
Basic symbols:
◦ A – Z: 0x41 – 0x5a
◦ a – z: 0x61 – 0x7a
◦ 0 – 9: 0x30 – 0x39
Special symbols:
◦ Null: 0x0
◦ Space: 0x20
◦ New line:
Carriage return: 0xd
Line feed: 0xa
Standard for text representation for most of the
known writing systems.
Has a few encoding implementations.
UTF-8
◦ Character encoding that implements unicode.
◦ Very common.
◦ Designed for backwards compatibility with ASCII.
The first 128 characters are the same.
We will only discuss ASCII in this course.
◦ You could always extend to UTF-8 later, if you want.
ASCII is a standard way to encode some very
simple symbols into 7 bits.
Unicode is a standard way to encode almost
any known character.
◦ UTF-8 is a very common character encoding to
implement unicode.
◦ UTF-8’s 128 first symbols are the same as ASCII’s
128 first symbols.
Study the printable part of the ASCII table.
◦ No need to learn it by heart :)