home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18314 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.7 KB  |  55 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!psinntp!viper!news
  3. From: brett@visix.com (Brett Bourbin)
  4. Subject: Re: HostileTakeOver of Amiga OS
  5. Sender: news@visix.com
  6. Message-ID: <C0Hsvs.AH4@visix.com>
  7. Date: Thu, 7 Jan 1993 16:38:15 GMT
  8. Reply-To: brett@visix.com
  9. References: <H9aywB8w165w@lakes.trenton.sc.us>
  10. Organization: Visix Software, Reston, Virginia
  11. Lines: 42
  12.  
  13. In article <H9aywB8w165w@lakes.trenton.sc.us> rock@lakes.trenton.sc.us  
  14. (Rockerboy) writes:
  15. > mcuddy@fensende.Rational.COM (Mike Cuddy) writes:
  16. > > the biggest gotcha when taking over the machine is that on >68000  
  17. machines,
  18. > > the exception vector table is not always at 0.  The VBR (vector base 
  19. > > register) is used to move the exception table into fast ram to avoid 
  20. > > contention with the custom chips.
  21. > Speaking of this, what is the proper way to find the base of the  
  22. vectors?
  23.  
  24.     move.l    (_AbsExecBase).W,A6    ; EXEC.library base pointer
  25.     sub.l    A1,A1            ; initialize offset to zero
  26.     btst.b    #AFB_68010,AttnFlags+1(A6)
  27.                     ; check if you need it
  28.     beq.s    .noVBR
  29.  
  30.     lea    .getVBR(PC),A5        ; get your VBR routine
  31.     jsr    _LVOSupervisor(A6)    ; switch to Supervisor mode
  32. ; On return A1 holds the VBR:
  33. noVBR:
  34.     move.l    VEC_xx(A1),myVEC_xx    ; save old vector "xx"
  35.     ...
  36.     move.l    #myNewVEC_xx,VEC_xx(A1)    ; install my new vector handler
  37.     ...
  38.     .your code.
  39.     ...
  40.     rts
  41.  
  42. getVBR:
  43.     OPT    P=68010            ; make sure you can generate it
  44.     movec    VBR,A1            ; get the VBR
  45.     rte                ; return from Supervisor mode
  46.     OPT    P=68000
  47.  
  48. All system legal.  8^)
  49. --             _  _    _      _
  50. Brett Bourbin        (_ |_ | /__ | |(_  4431 Lehigh Road, Suite 151
  51.   brett@visix.com    __)|_ |_\_/ \_/__) College Park, Maryland 20740
  52.   ..uupsi!visix!brett          LIMITED       703.758.2733
  53.