Crossware

Table of Contents        Previous topic       Next topic       

COMPILER LIBRARY FUNCTIONS->Detailed Descriptions->_setvect()

Summary


#include <os.h>

void _setvect(unsigned int n, void(_interrupt* fnp)());Set the interrupt handler
Parameters

n        Address of interrupt vector
fpn        Pointer to the interrupt handler


Description

There are two versions of this function.  One for the 68000 and one for the CPU32 and 68020.

For the 68000, this routine assumes that the target system has been configured so that control will pass to the ram address n when the specified interrupt occurs.  It therefore places a long JMP opcode ($4EF9) at address n and places the address of the interrupt handler immediately after this opcode.  This will cause the interrupt handler to be executed when the interrupt occurs.

For the CPU32 and 68020 the use of a jump table is unnecessary since the chips provide the Vector Base Regsiter (VBR) to allow the vector table to be relocated.  Therefore the function places the address of the interrupt handler at address n.

Header file os.h contains prototypes for _getvect() and _setvect().  Header file os.h also contains the vector numbers for the 680X0 and these can be used in conjunction with the _X_VO predefined macro to calculate the value of n at compile time.


Return Value

None.