Displaying Source Code(s)
|
|
Character Eater
--------------------------------------------------------------------------------
Description : This TSR program hooks itself with timer interrupt
and selects a random row and coloums position at each run and
writes space at that position, the person using the computer
feels that something is eating up the characters from the
screen.
#include"dos.h"
#include<conio.h>
#include<stdlib.h>
void interrupt (*prevtimer)();
void interrupt mytimer();
void writechar(char ch,int row,int col,int attr);
char far* scr;
int a,b;
void main()
{
scr=(char far*) 0xb8000000;
prevtimer=getvect(8);
setvect(8,mytimer);
keep(0,1000);
}
void interrupt mytimer()
{
a=random(25);
b=random(80);
writechar(' ',a,b,0);
(*prevtimer)();
}
void writechar(char ch,int row,int col,int attr)
{
*(scr+row*160+col*2)=ch;
*(scr+row*160+col*2+1)=attr;
}
|
|
|