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 >
Text File  |  1992-10-12  |  550b  |  24 lines

  1.   static void near error_return(void)
  2.   {
  3.     longjmp(error::current->jmpbuf, 1);
  4.   }
  5.  
  6.   void declare_error(void)
  7.   {
  8.     _AX = (int) error_return;
  9.     asm MOV BP,[BP];  // move frame pointer up one level
  10.     asm MOV [BP+2],AX;  // patch return address
  11.     #if defined(__MEDIUM__) || defined(__LARGE__) || defined(__HUGE__)
  12.       asm MOV [BP+4],CS; // if return address is far, patch segment, too
  13.     #endif
  14.   }
  15.  
  16.   error error_x;
  17.   if (setjmp(error_x.jmpbuf))
  18.   {
  19.     <garbage collection>
  20.     declare_error();
  21.     return;
  22.   }
  23.  
  24.