home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 179 / comm / bomb.c next >
Encoding:
C/C++ Source or Header  |  1987-09-15  |  534 b   |  31 lines

  1. #include <osbind.h>
  2.  
  3. long fixup,vec;
  4.  
  5. fixit()
  6. {
  7. int *start;
  8.     if ((*(int *)vec) == 0x4e73)
  9.     { /* if already pointing at RTE, leave alone */
  10.         fixup = vec;
  11.         return;
  12.     }
  13.     start = (int *) 0xFC0000; /* start of ROM */
  14.     while (*start++ != 0x4e73) /* 0x4e73 is RTE */
  15.         ;
  16. /* don't worry, we'll find one SOMEWHERE in ROM */
  17.     fixup = (long)start;
  18. }
  19.  
  20. main()
  21. {
  22.     vec = Setexc(5,-1L);
  23.     printf("%lx\n",vec);
  24.     Supexec(fixit);
  25.     if (fixup != vec)
  26.     {
  27.         printf("Vector was not pointing at RTE!\n");
  28.         Setexc(5,fixup);
  29.     }
  30. }
  31.