Board index » cppbuilder » geninterrupt

geninterrupt


2003-10-29 05:56:30 PM
cppbuilder71
What is the parameter for geninterrupt() if I want to shutdown a system?
Thanks.
-----------------------------------------------------
This message was posted using www.gdse.com/
 
 

Re:geninterrupt

You have not mentioned any of this:
which compiler and what version of the compiler is being used
what operating system you are writing for
if you are writing in C or in C++
if a 16 bit program, what memory model is being used
On most platforms you cannot shut down the machine. What you can do is to
reboot it.
Assuming that you are using BC++ for a 16 bit small model DOS target,
something like this might reboot it.
----------------------
#include <dos.h>
#define COLD 0
#define WARM 0x1234
unsigned short far *warm_cold_boot_flag =
(unsigned short far *) MK_FP(0x0040, 0x0072);
int main()
{
*warm_cold_boot_flag = COLD; /* change to WARM for a warm boot */
geninterrupt(0x19);
return 0;
}
----------------------
. Ed
Quote
Kuro wrote in message
news:3f9f9cde$ XXXX@XXXXX.COM ...

What is the parameter for geninterrupt() if I want
to shutdown a system?
 

Re:geninterrupt

Kuro wrote:
Quote
What is the parameter for geninterrupt() if I want to shutdown a system?
Thanks.

-----------------------------------------------------
This message was posted using www.gdse.com/
Kuro, If your are referring to 5.02, then all I can tell you is what it
gives as an example in the manual!
#include <conio.h>
#include <dos.h>
/* function prototype */
void writechar(char ch);
int main(void)
{
clrscr();
gotoxy(80,25);
writechar('*');
getch();
return 0;
}
/*
outputs a character at the current cursor
position using the video BIOS to avoid
the scrolling of the screen when writing
to location (80,25).
*/
void writechar(char ch)
{
struct text_info ti;
/* grab current text settings */
gettextinfo(&ti);
/* interrupt 0x10 sub-function 9 */
_AH = 9;
/* character to be output */
_AL = ch;
_BH = 0; /* video page */
_BL = ti.attribute; /* video attribute */
_CX = 1; /* repetition factor */
geninterrupt(0x10); /* output the char */
}
 

{smallsort}