0

I need to output some string using interrupt Int 65 but its giving me error i am using Turbo C++ 4.0 Windows 7 Windows 8 64Bit Version

#include<stdio.h>
#include<fcntl.h>
#include<io.h>
#include<BIOS.H>
#include<DOS.h>

void interrupt (*oldint65)( );
char st[80] = {"Hello World$"};
void interrupt newint65(void);

void main()
{
  oldint65 = getvect(0x65);
  setvect(0x65, newint65);
  geninterrupt (0x65);
  geninterrupt (0x65);
  geninterrupt (0x65);
  setvect(0x65, oldint65);
}

void interrupt newint65( )
{
  _AH = 0x09;
  _DX=(unsigned int)st;
  geninterrupt (0x21);
}

i have attached error image please help me where i am doing wrong

Error image

Morten Kristensen
  • 7,412
  • 4
  • 32
  • 52
Bilal Maqsood
  • 1,163
  • 3
  • 15
  • 43

2 Answers2

2

Function definition is not matching/Clashing with the declaration.. Check:

  • void interrupt (*oldint65)();
  • void interrupt *newint65(void);

A single name interrupt Can't have 2 declarations..

Change in program should be as follows:

Declaration:

void interrupt(*newint65)(void);

Definition:

void interrupt(*newint65)( ) 
{ 
  _AH = 0x09; 
  _DX=(unsigned int)st; 
  geninterrupt (0x21); 
}
Morten Kristensen
  • 7,412
  • 4
  • 32
  • 52
user388229
  • 109
  • 5
2

Try: Declaration:

void interrupt_newint65(void);

Definition:

 void interrupt_newint65( ) 
 { 
 _AH = 0x09; 
 _DX=(unsigned int)st; 
 geninterrupt (0x21); 
 }
user388229
  • 109
  • 5