// erfordert 16-Bit-Compiler unter DOS (z.B. Borland C++ 3.1) struct Farbe // Bitfeld { unsigned vg: 4; // Vordergrundfarbe 0...15 unsigned hg: 3; // Hintergrundfarbe 0...7 unsigned bl: 1; // Blinkbit 0...1 }; union { unsigned char color; struct Farbe bits; } attrib; // Farbatttribut des Textbildschirms int main() { attrib.bits.vg = 14; // YELLOW attrib.bits.hg = 1; // BLUE attrib.bits.bl = 1; // attrib.color = YELLOW+BLUE<<3+BLINK; char far* const screen = (char far*) 0xB8000000; // IBM-PC, DOS VGA Mode 3 for (int i = 0; i < 256; i++) { screen[2*i] = i; // kompletter IBM-Zeichensatz screen[2*i+1] = attrib.color; // gelb auf blau blinkend } return 0; }