Here is what the programme will do...
if user presses "A" the result would be somthing else, like any other letter except "A"
the code that i have written so no errors but it also does'nt give any output
Herz the code....
i am using borland compiler to run the code......
#include<stdio.h>
#include<conio.h>
#include<bios.h>
#include<dos.h>
void interrupt (*oldint15)();
void interrupt newint15(unsigned int BP,unsigned int DI,
unsigned int SI,unsigned int DS,
unsigned int ES,unsigned int DX,
unsigned int CX,unsigned int BX,
unsigned int AX,unsigned int CS,
unsigned int IP,unsigned int flags);
void main()
{
oldint15 = getvect(0x15);
setvect(0x15,newint15);
keep(0,1000);
getch();
}
void interrupt newint15(unsigned int BP,unsigned int DI,
unsigned int SI,unsigned int DS,
unsigned int ES,unsigned int DX,
unsigned int CX,unsigned int BX,
unsigned int AX,unsigned int CS,
unsigned int IP,unsigned int flags)
{
if(*(((char*)&AX)+1)==0x4F)
{
//q to a
if(*((char*)&AX)==0x10)
*((char*)&AX)=0x1E;
else if(*((char*)&AX)==0x1E)
*((char*)&AX)=0x10;
//w to s
if(*((char*)&AX)==0x11)
*((char*)&AX)=0x1F;
else if(*((char*)&AX)==0x1F)
*((char*)&AX)=0x11;
//e to d
if(*((char*)&AX)==0x12)
*((char*)&AX)=0x20;
else if(*((char*)&AX)==0x20)
*((char*)&AX)=0x12;
//r to f
if(*((char*)&AX)==0x13)
*((char*)&AX)=0x21;
else if(*((char*)&AX)==0x21)
*((char*)&AX)=0x13;
//t to g
if(*((char*)&AX)==0x14)
*((char*)&AX)=0x22;
else if(*((char*)&AX)==0x22)
*((char*)&AX)=0x14;
//y to h
if(*((char*)&AX)==0x15)
*((char*)&AX)=0x23;
else if(*((char*)&AX)==0x23)
*((char*)&AX)=0x15;
//u to j
if(*((char*)&AX)==0x16)
*((char*)&AX)=0x24;
else if(*((char*)&AX)==0x24)
*((char*)&AX)=0x16;
//i to k
if(*((char*)&AX)==0x17)
*((char*)&AX)=0x25;
else if(*((char*)&AX)==0x25)
*((char*)&AX)=0x17;
//o to l
if(*((char*)&AX)==0x18)
*((char*)&AX)=0x26;
else if(*((char*)&AX)==0x26)
*((char*)&AX)=0x18;
}
getch();
}
This post has been edited by irfan_furion: 21 June 2009 - 01:00 AM

New Topic/Question
Reply



MultiQuote





|