View Single Post
Old 15 January 2011, 21:16   #2
pmc
gone
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Hey korruptor

Yeah, you need to get the VBR.

This code will do it, just bsr to it in your startup before you need to set up your interrupt:

Code:
execbase	equ	$4
supervisor	equ	-30
attnflags	equ	296


.get_vbr:	move.l	execbase.w,a6
	btst	#0,attnflags+1(a6)
	bne.s	.need_vbr
	lea	sys_vbr_addr(pc),a0
	move.l	#0,(a0)
	rts

.need_vbr	lea	.get_vbr_code(pc),a5
	jsr	supervisor(a6)
	lea	sys_vbr_addr(pc),a0
	move.l	d0,(a0)
	rts

.get_vbr_code:	movec	vbr,d0
	rte

sys_vbr_addr:	dc.l	0
Don't thank me for the above, thank StingRay.
pmc is offline  
 
Page generated in 0.06396 seconds with 11 queries