home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 321.lha / VBR / VBR.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-12  |  798 b   |  36 lines

  1. #include "exec/types.h"
  2. #include "exec/execbase.h"
  3. #include "exec/memory.h"
  4. #include "libraries/dos.h"
  5. #include "proto/exec.h"
  6. #define VECTSIZE (0x400)
  7.  
  8. struct ExecBase *ExecBase;
  9. ULONG *OldVects;
  10. ULONG *NewVects;
  11.  
  12. extern MoveVects ();
  13.  
  14. main ()
  15. {
  16.  ExecBase=(struct ExecBase *)4;
  17.  if ((ExecBase->AttnFlags)&AFB_68010)
  18.    {
  19.     printf ("This Amiga does not have a VBR register.\n");
  20.     exit (RETURN_WARN);
  21.    }
  22.  if (!(NewVects=(ULONG *)AllocMem (VECTSIZE,MEMF_CLEAR|MEMF_PUBLIC|MEMF_FAST)))
  23.    {
  24.     printf ("No fast memory was available.\n");
  25.     exit (RETURN_FAIL);
  26.    }
  27.  if (!MoveVects ())
  28.    {
  29.     FreeMem (NewVects,VECTSIZE);
  30.     printf ("Vectors located at $%lx.\n",OldVects);
  31.     exit (RETURN_FAIL);
  32.    }
  33.  printf ("Vectors moved from $%lx to $%lx.\n",OldVects,NewVects);
  34.  exit (RETURN_OK);
  35. }
  36.