ASCII: Difference between revisions

1,322 bytes added ,  2 years ago
m
no edit summary
(Created page with "Category:Encyclopedia '''ASCII''' stands for <i>American Standard Code For Information Interchange</i>. It was first created in 1963 and is the basis for standardized dat...")
 
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1:
[[Category:Encyclopedia]]
'''ASCII''' stands for <i>American Standard Code For Information Interchange</i>. It was first created in 1963 and is the basis for standardized data encoding methods such as [[Unicode]] that almost all computers follow today. The original ASCII standard defines 128 bytesdifferent values, each of which represent different characters, such as the alphabet, numbers, punctuation, etc. Unlike UTF-8, every ASCII character is exactly one byte long, making routines that use ASCII very easy to write.
 
'''ASCII''' stands for <i>American Standard Code For Information Interchange</i>. It was first created in 1963 and is the basis for standardized data encoding methods such as [[Unicode]] that almost all computers follow today. The original ASCII standard defines 128 bytes, each of which represent different characters, such as the alphabet, numbers, punctuation, etc.
 
==Control Codes==
Line 7 ⟶ 6:
 
* 0: (<code>NUL</code>). This is probably one of the most important codes of all. This marks the end of a text string, or other various data fields. Without it, your typical "putS" (Print String) routine would go on forever and eventually crash! Computers don't understand the concept of the end of a data range natively, and often rely on NUL to know when to stop reading. (Some languages place the string size as metadata before the actual string itself, but others use a null terminator)
 
 
* 7: Bell (<code>BEL</code>). The computer makes a beeping sound when reading this control code.
 
 
* 8: Backspace (<code>BS</code>). This will delete the character placed before the cursor.
 
 
* 9: Horizontal Tab (<code>HT</code>). This is your Tab key.
 
 
* 10: Line Feed (<code>LF</code>). This causes the text cursor to move down to the next line, but its horizontal position is unchanged. The phrase "line feed" is also from typewriters, where turning the knob would <i>feed</i> more paper through the carriage. ASCII 13 followed by ASCII 10 makes up a "new line" command (aka <code>\n</code> in [[C]])
 
 
* 13: Carriage Return (<code>CR</code>). This causes the text cursor to go back to the far-left side of the screen (in the days of ASCII, computers weren't designed for languages other than English, so this assumed you were writing left to right. The term "carriage return" comes from typewriters, when pressing the "return" key would make the <i>carriage</i> (the cylinder that held the paper) slide back to the left.
 
 
* 27: <code>ESC</code>. This is the Escape key!
 
* 32: This is what you get when you hit the spacebar. (It's a blank space.) This was the most convenient location for the space character to be, as it's just in front of the actual visible characters. Old-school computers often implemented ASCII by using the value associated with each character as an index for a lookup-table of tile graphics stored in ROM, and having the beginning be the blank space meant that you could convert ASCII to the table format by simply subtracting 32, and a video memory that is initialized to zero will show blank spaces instead of whatever character happens to be at that index.
 
* 127: <code>DEL</code>. This is the Delete key, and is also the last standardized ASCII code. For some reason it's not placed with the other control codes.
 
Anything from 128 to 255 was dependent on the hardware and/or the program being run. Many programs used this extra space to represent letters with accent marks common to non-English languages that used the Latin alphabet, as well as rudimentary character graphics to allow for simple game creation (such as playing card suits, smiley faces, stickmen, etc.)
 
==Numbers==
Line 35 ⟶ 46:
* 4 <-> $
* 5 <-> %
* , <-> < (Comma and Less Than Sign)
* . <-> > (Period and Greater Than Sign)
* / <-> ?
 
Other punctuation keys do not follow this "bit 4 rule" anymore. They most likely did on keyboards in the late 20th century but don't follow it now.
 
 
==Citations==
1,489

edits