If you write directly to the video text buffer, each screen symbol cell corresponds to a pair of bytes, one of which is a symbol to display, the other by its colors. See http://en.wikipedia.org/wiki/VGA_compatible_text_mode
It may seem a bit complicated at first, but it's actually quite simple. This is a bit unfamiliar. Using ANSI escape sequences requires a fairly small amount of output, while a text buffer is one 16-bit word per character.
Not that it mattered, but it was necessary to write a text buffer on the hardware of a past era to get the response changes. The transition through the ANSI interface took considerable time.
source share