Blinking characters on Intel 8086

980 views Asked by At

I'm working on drawing some shapes directly using the graphics card without interrupts for Intel 8086 (TASM) and I read that the 7th bit in the byte responsible for background and foreground colours can make the characters blink.

How can I set it, though, while the colours themselves are indexed 0-15 and I have only 1 byte? I mean: I can set the colour byte to 1eh so that I have a yellow char on blue background. How can I squeeze the information about the desired blinking in there?

1

There are 1 answers

0
Michael On BEST ANSWER

How can I set [the 7th bit], though, while the colours themselves are indexed 0-15 and I have only 1 byte?

It's actually bit 7, not the 7th bit (those two are not the same). The mask for bit 7 is 80h (or 128 decimal), so to set a green color with blinking on you'd use an attribute of 82h, for blinking magenta it would be 85h, and so on.