home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
c
/
cuj9301.zip
/
1101042A
< prev
next >
Wrap
Text File
|
1992-10-12
|
550b
|
24 lines
static void near error_return(void)
{
longjmp(error::current->jmpbuf, 1);
}
void declare_error(void)
{
_AX = (int) error_return;
asm MOV BP,[BP]; // move frame pointer up one level
asm MOV [BP+2],AX; // patch return address
#if defined(__MEDIUM__) || defined(__LARGE__) || defined(__HUGE__)
asm MOV [BP+4],CS; // if return address is far, patch segment, too
#endif
}
error error_x;
if (setjmp(error_x.jmpbuf))
{
<garbage collection>
declare_error();
return;
}