Hi everyone. I have written an MS-DOS based screensaver program by hooking timer and keyboard interrupt. After 10 seconds the screen is cleared and on clicking any button from the keyboard the contents of dos screen are shown. I want to know how can I make this screen to blink i.e. alternate between cleared screen and screen with text shown when no button is pressed for 10 seconds. If you need further information I can describe what I am trying to achieve. Here is my written code:

#include <dos.h>
#include <conio.h>
void interrupt (*oldTimer)();
void interrupt (*oldKey)();
void interrupt newTimer();
void interrupt newKey();
char far *scr = (char far*) 0xB8000000;
int i, t=0, m=0;
char charscr[4000];

void main()

keep (0,1000);


void interrupt newTimer()
    for (i=0;i<4000;i++)
    charscr [i]=*(scr+i);
    for (i=0;i<=4000;i+=2)


    t=0; m=1;


void interrupt newKey()
int w;
for (w=0; w<4000;w++)

Probably the old school way, use the timer and switch the foreground color between what you're using now and the background color and back again. When it's the background color the text is still there but invisible.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.