*******************************************************************************
* This function provides a method of obtaining a pointer to the base of the
* interrupt vector table on all Amigas.  After getting this pointer, use
* the vector address as an offset.  For example, to install a level three
* interrupt you would do the following:
*
*		bsr	_GetVBR
*		move.l	d0,a0
*		move.l	#MyIntCode,$6c(a0)
*
* That's all there is to it!  This will help make your program work on
* many more Amigas than is you just did this:
*
*		move.l	#MyIntCode,$6c.w
*
* Enjoy!
*******************************************************************************

		incdir	'df0:include/'
		include	'exec/exec_lib.i'
		include	'exec/execbase.i'

*******************************************************************************
* Inputs: none
* Output: d0 contains vbr.

_GetVBR:	moveq	#0,d0			; clear
		movea.l	4.w,a6			; exec base
		btst.b	#AFB_68010,AttnFlags+1(a6); are we at least a 68010?
		beq.b	.1			; nope.
		lea.l	vbr_exception(pc),a5	; addr of function to get VBR
		jsr	_LVOSuperVisor(a6)	; supervisor state
.1:		rts				; return

vbr_exception:
	; movec vbr,Xn is a priv. instr.  You must be supervisor to execute!
;		movec   vbr,d0
	; many assemblers don't know the VBR, if yours doesn't, then use this
	; line instead.
		dc.w	$4e7a $0801
		rte				; back to user state code

*******************************************************************************
