home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
321.lha
/
VBR
/
VBR.asm
< prev
next >
Wrap
Assembly Source File
|
1989-12-12
|
816b
|
47 lines
SECTION Code
INCLUDE "exec/execbase.i"
INCLUDE "exec/libraries.i"
INCLUDE "exec/ables.i"
INT_ABLES
ABSEXECBASE EQU 4
XDEF _MoveVects
XREF _LVOSupervisor
XREF _OldVects
XREF _NewVects
_MoveVects:
MOVEM.L A5/A6,-(SP)
MOVE.L ABSEXECBASE,A6
LEA.L MoveVectsTrap(PC),A5
JSR _LVOSupervisor(A6)
EndMoveVects:
MOVEM.L (SP)+,A5/A6
RTS
MoveVectsTrap:
DISABLE D0 ; Disable interrupts
MOVEC.L VBR,A0 ; Get VBR register
MOVE.L A0,_OldVects
BNE VectsMoved ; Already been moved
MOVE.L _NewVects,A1
MOVE.L #$FF,D0 ; Size=$400
1$: MOVE.L (A0)+,(A1)+ ; Copy the vectors
DBF D0,1$
MOVE.L _NewVects,A1
MOVEC.L A1,VBR ; Now change the VBR register
ENABLE D0 ; Enable interrupts
MOVEQ.L #1,D0 ; Return True
RTE
VectsMoved:
ENABLE D0 ; Enable interrupts
MOVEQ.L #0,D0 ; Return False
RTE
END