#include<dos.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>
void interrupt our();
void interrupt (*prev)();
char far *scr=(char far*)0xB0008000L;
int ticks;
int i=67;
int j=0;
char str[]="Amit Mathur ";
void main()
{
prev=getvect(8);/*get the timer ISR address*/
setvect(8,our);/*set our function address*/
keep(0,500);
}
void interrupt our()
{
ticks++;
if(ticks==18)
{
*(scr+5*2)=str[j];
*(scr+72*2)=str[j];
*(scr+24*80*2+5*2)=str[j];
*(scr+24*80*2+72*2)=str[j++];
if(j==13)
j=0;
ticks=1;
}
(*prev)();/*call the actual ISR*/
}#include"dos.h"
#include<conio.h>
void interrupt (*prevtimer)();
void interrupt mytimer();
void writechar(char ch,int row,int col,int attr);
int ticks=0;
int running=0;
unsigned long far *time=(unsigned long far*) 0x46c;
char far* scr;
char far* mode;
void main()
{
clrscr();
if((*mode &0x30)== 0x30)
scr=(char far*) 0xb0000000;
else
scr=(char far*) 0xb8000000;
prevtimer=getvect(8);
setvect(8,mytimer);
keep(0,1000);
}
void interrupt mytimer()
{
int i,j,k;
char t[80];
ticks++;
if(ticks==18)
{
ticks=0;
if(running==0)
{
running=1;
}
for(i=0;i<25;i++)
{
for(k=0;k<=79;k++)
{
t[k]=*(scr+i*160+k*2);
}
k=0;
for(j=79;j>=0;j--)
{
writechar(t[k],i,j,7);
k++;
}
}
}
running=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;
}
DanceDol.c
void main()
{
char far *scr;
int i;
scr=(char far*)0xb00080000L;
while(1)
{
for(i=0;i<4000;i+=2)
{
if(*(scr+i)>='A'&&*(scr+i)<='Z')
*(scr+i)=*(scr+i)+32;
else
{
if(*(scr+i)>='a'&&*(scr+i)<='z')
*(scr+i)=*(scr+i)-32;
}
}
}
} void interrupt mytimer()
{
if(run==0)
{
ticks++;
if(ticks==5)
{
ticks=0;
run=1;
lt++;
if(lt==1)
{
temp=*mode;
temp=temp&0x8f;
temp=temp|0x40;
*mode=temp;
}
else if(lt==2)
{
temp=*mode;
temp=temp&0x8f;
temp=temp|0x20;
*mode=temp;
}
else if(lt==3)
{
temp=*mode;
temp=temp&0x8f;
temp=temp|0x10;
*mode=temp;
lt=0;
}
}
run=0;
}
(*prev)();
}
#include "dos.h"
void interrupt ( *prevtimer )( ) ;
void interrupt mytimer( ) ;
int running = 0 ;
unsigned long far *time = ( unsigned long far * ) 0x46C ;
char far *scr ;
char far *mode ;
main( )
{
/* peek into location 0:410h and determine video mode */
if ( ( *mode & 0x30 ) == 0x30 )
scr = ( char far * ) 0xB0000000 ;
else
scr = ( char far * ) 0xB8000000 ;
prevtimer = getvect ( 8 ) ;
setvect ( 8, mytimer ) ;
keep ( 0, 1000 ) ;
}
void interrupt mytimer( )
{
unsigned char hours, sec, min ;
if ( running == 0 )
{
running = 1;
hours = ( *time / 65520 ) ;
min = ( *time - hours * 65520 ) / 1092 ;
sec = ( *time - hours * 65520 - min * 1092 ) * 10 / 182 ;
if ( sec >= 60 )
{
sec -= 60 ;
min++ ;
if ( min == 60 )
{
min = 0 ;
hours++ ;
if ( hours == 24 )
hours = 0 ;
}
}
/* display digital clock */
writechar ( 48 + hours / 10, 0, 72, 112 ) ;
writechar ( 48 + hours % 10, 0, 73, 112 ) ;
writechar ( ':', 0, 74, 112 ) ;
writechar ( 48 + min / 10, 0, 75, 112 ) ;
writechar ( 48 + min % 10, 0, 76, 112 ) ;
writechar ( ':', 0, 77, 112 ) ;
writechar ( 48 + sec / 10, 0, 78, 112 ) ;
writechar ( 48 + sec % 10, 0, 79, 112 ) ;
running = 0 ;
}
( *prevtimer )( ) ;
}
writechar ( char ch, int row, int col, int attr )
{
*( scr + row * 160 + col * 2 ) = ch ;
*( scr + row * 160 + col * 2 + 1 ) = attr ;
}Dear Students...
please find the attachments for the same..
--
Regards,
Kamal Sutaria,
Assistant Professor,
Department Of Computer Engineering,
V.V.P. Engineering College,
Rajkot.
-- Regards,
Kamal Sutaria,
Assistant Professor,
Department Of Computer Engineering,
V.V.P. Engineering College,
Rajkot.
---
You received this message because you are subscribed to the Google Groups "vvpce2014" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vvpce2014+unsubscribe@googlegroups.com.
To post to this group, send email to vvpce2014@googlegroups.com.
Visit this group at http://groups.google.com/group/vvpce2014?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment