I'm exploring some new technology by revisiting some old technology. I make no promise to the frequency of posts, but before delving into the specifics of what I'm attempting, some background information is necessary.
The old technology I'm looking at is something that was developed on DOS in the early 1990s. It used the standard 80x25 text mode in order to show various colored characters. The characters came from the 8-bit extended ASCII table. If my memory doesn't fail me, the standard ASCII table is 7-bits, which means it stores characters from index 0 to 127 (27 - 1) for a total of 128 characters. The 8-bit extended ASCII table provides for 256 characters, from index 0 to 255 (28 - 1). However, the first 32 characters are known as "non-printable." Although most have some graphical repesentation behind them, they are control characters meant to signal the printer or DOS to do something such as beep or insert a tab or go to the next line. These first 32 characters are listed below.
| Character |
Meaning |
| 0 |
(null) |
| 1 |
Start of Heading |
| 2 |
Start of Text |
| 3 |
End of Text |
| 4 |
End of Transmission |
| 5 |
Enquiry |
| 6 |
Acknowledge |
| 7 |
Bell |
| 8 |
Backspace |
| 9 |
Horizontal Tab |
| 10 |
Linefeed (new line) |
| 11 |
Vertical Tab |
| 12 |
Form feed (new page) |
| 13 |
Carriage Return |
| 14 |
Shift Out |
| 15 |
Shift In |
| 16 |
Data Link Escape |
| 17 |
Device Control 1 |
| 18 |
Device Control 2 |
| 19 |
Device Control 3 |
| 20 |
Device Control 4 |
| 21 |
Negative Acknowledge |
| 22 |
Synchronous Idle |
| 23 |
End of Transmission Block |
| 24 |
Cancel |
| 25 |
End of Medium |
| 26 |
Substitute |
| 27 |
Escape |
| 28 |
File Separator |
| 29 |
Group Separator |
| 30 |
Record Separator |
| 31 |
Unit Separator |
I'm listing these mostly for curiousity's sake (these are cribbed from http://www.asciitable.com). Characters 1 through 26 also correspond to Ctrl-A through Ctrl-Z (sometimes seen as ^A or ^G, the caret representing the Ctrl key). Even in modern programming we still encounter some of these characters, most significantly tab, carriage return and newline, which we know as \t, \r and \n in C# and other high level languages. The carriage return was used to make the cursor (and I'm fairly sure some printer heads, dating back to typewriters) go to the beginning of the current line, and then newline was used to advance the cursor to the next line. This is why seeing "\r\n" is common on Windows. The next character, 32, is the space, and this is where the printable area of the ASCII table starts. Interestingly, the control characters all have a symbol behind them (except for 0, which is empty but is treated as distinct from the space, character 32. The index into the ASCII table is what matters, not how it looks). Character 1, for example, is a hollow happy face, and character 2 is a filled in happy face. Each character in the ASCII table is made up of 8x16 pixels. Since the DOS text mode I'm looking at here is 80 characters across and 25 down, this gives us 80*8 x 25*16 pixels, or 640x400 for the video mode resolution. This character set, even the non-printable range, can be drawn to the screen on DOS. Each character can also have a foreground and background color.
DOS supports coloring of characters based on two hex values combined to form foreground and background. An alternate way to color on DOS is using ANSI escape sequences, but we aren't concerned with ANSI escape sequences here. If, right now, you open a command window (Win-R, type "cmd" and enter) and then type "color /?" at the prompt, you'll get a list of colors that correspond to each hex value. The colors Aqua/Cyan are the same, and Purple/Magenta are the same, incase you encounter these variant names somewhere. The "color" command uses "Aqua" and "Purple" but for what I'm working on, we will use its terminology, "Cyan" and "Purple." Also, different from the color command, there is no dark yellow (it's brown) or bright yellow (it's simply yellow). The full list of colors are listed next.
| Value |
Color |
| 0 |
Black |
| 1 |
Blue |
| 2 |
Green |
| 3 |
Cyan |
| 4 |
Red |
| 5 |
Purple |
| 6 |
Brown |
| 7 |
White |
| 8 |
Grey |
| 9 |
Bright Blue |
| A |
Bright Green |
| B |
Bright Cyan |
| C |
Bright Red |
| D |
Bright Purple |
| E |
Yellow |
| F |
Bright White |
It isn't essential to know how these colors are used when printing a character, other than the fact that the color information can be stored in a single byte, where the upper nibble is the foreground color and the lower nibble is the background color. Thus E9 is yellow text on a bright blue background. The color command places the background color first, so if you want to try to change your command window colors, type "color 9E" for yellow on bright blue.
The next goal is to ensure we have the full set of ASCII characters (all 256) and the proper colors (we can use an eye dropper from a Paint tool to get exact RGB from a command window), all formatted for the presentation framework I intend to use. This is what will come next, and shortly after, an introduction of exactly what I'm attempting to create.