Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I set txt attribute for blinking?

378 views
Skip to first unread message

Daniel Elliott

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to

I'm having trouble getting my text to blink. I get the correct colors for
the foreground and background, but no blinking. The code I am using is as
follows:
...
mov ah, 09h
mov al, 'a'
mov bh, 00h
mov bl, 11000111b ; This should set the char to a red background and a
white forground. Also it should blink.
mov cx, 1
int 10h
...

Anyway, I get the right colors, but no blinking at all. If anyone could
give me a pointer, I'd really appreciate it.

--Dan



hayden rosser

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to

as I understand, not all video cards support blinking. Sometimes that bit is
used for something else, though I can't remember what. Probably underline or
something, but then you would have noticed that.

haydens


Caisson

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to
Daniel Elliott <djel...@gw.total-web.net> schreef in artikel
<saf1f6...@corp.supernews.com>...

Hello Daniel,



> I'm having trouble getting my text to blink. I get the correct colors
for
> the foreground and background, but no blinking. The code I am using is as
> follows:

<Snip>

> mov bl, 11000111b ; This should set the char to a red background
and a
> white forground. Also it should blink.

Try:
mov bl, 01000111b

if the Back-ground color is now (mostly, but not allways) the same color,
but not-as-bright, your screen uses the Highest bit as Intensety, not
Blink.
To toggle the function of this bit, see the Bios-int 10h, AX=1003h.

Regards,
Rudy Wieser


Alexei A. Frounze

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to
You must "tell" to BIOS that the most significian bit is a "blinking"
but not a "brightness".

------------------8<------------------------
Mov AX,1003h
Mov BL,0
Int 10h (16 background colors, no blinking)
------------------8<------------------------
Mov AX,1003h
Mov BL,1
Int 10h (8 background colors, blinking)
------------------8<------------------------

Good Luck
Alexei A. Frounze

Daniel Elliott wrote:
>
> I'm having trouble getting my text to blink. I get the correct colors for
> the foreground and background, but no blinking. The code I am using is as
> follows:

> ...
> mov ah, 09h
> mov al, 'a'
> mov bh, 00h

> mov bl, 11000111b ; This should set the char to a red background and a
> white forground. Also it should blink.

Alexander Noe

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to
Daniel Elliott schrieb:

>
> I'm having trouble getting my text to blink. I get the correct colors for
> the foreground and background, but no blinking. The code I am using is as
> follows:
> ...
> mov ah, 09h
> mov al, 'a'
> mov bh, 00h
> mov bl, 11000111b ; This should set the char to a red background and a
> white forground. Also it should blink.
> mov cx, 1
> int 10h
> ...

Is your background color light red instead of "normal" red? If yes, then
you have to set bit 3 of "mode control register" of the "attribute
controller" of the vga-card:

mov dx, 3DAh
in al, dx
-> read input status #1 register to enabled access to index reg. of
attribute controller

mov dx, 3C0h
mov al, 10h
out dx, al
-> enable access to mode control register
inc dx
in al, dx
-> original value of mode control register into al
dec dx
or al, 8
out dx, al
-> set bit 3 of mode control register
mov al, 20h
out dx, al
-> allow video card to access attribute controller, otherwise the screen
maintains black

Now your blinking text should work.


MfG Alexander

Daniel Elliott

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to

Daniel Elliott <djel...@gw.total-web.net> wrote in message
news:saf1f6...@corp.supernews.com...


>
> I'm having trouble getting my text to blink. I get the correct colors for

<snip>

Thanks for the pointers everyone--code works fine now. Of the two ways
posted in replies to my original question, is there a preferred or best way
of setting this? I'm just curious, because one of the methods used a call
to Bios-int10h, ax = 1003 to set the intensity/blinking attribute (which I
found documented in MASM after more searching this morning), and the other
uses what I guess is manipulation of I/O (Alexander Noe's reply). Is
there any documentation available that elaborates on VGA processes and
programming? Not looking for anything fancy here, just the basics as I'm
still new to assembler. Thanks again for the help :)

--Dan


Alexei A. Frounze

unread,
Feb 14, 2000, 3:00:00 AM2/14/00
to

BIOS does the same stuff as Alexander Noe suggested. But BIOS doc is
more clear than just a hardware VGA port layout.
Btw, if your video system is not standard, BIOS function will work
anyway, but port I?O might not work properly. AFAIK there is not
non-standard VGA compatible cards nowadays.

If you wanna know more about VGA registers look for tutorials because
short descriptions of port layout is useless, since you don't know how
it really works.

Good Luck.
Alexei A. Frounze

0 new messages