SetIntVec Function (Macro)

intr.h

void SetIntVec (long IntVec, INT_HANDLER Handler);

Sets an interrupt vector.

SetIntVec sets the interrupt vector located at the absolute address IntVec to the interrupt handler pointed to by Handler. Handler should be either a value returned from GetIntVec, or the address of a user-defined interrupt handler defined using DEFINE_INT_HANDLER. Note that Handler may not be the address of an ordinary C function.

Typical values of IntVec are given in the following table as enumerated in the IntVecs enum:

AddressAssociated ConstantTriggered On
0x04INT_VEC_RESETReset (contains pointer to OS entry point)
0x08INT_VEC_BUS_ERRORBus error
0x0CINT_VEC_ADDRESS_ERRORAddress error (accessing a short or long at an odd address)
0x10INT_VEC_ILLEGAL_INSTRUCTIONIllegal instruction
0x14INT_VEC_ZERO_DIVIDEDivision by zero
0x18INT_VEC_CHK_INSCHK instruction
0x1CINT_VEC_TRAPV_INSTRAPV instruction
0x20INT_VEC_PRIVILEGE_VIOLATIONPrivilege violation
0x24INT_VEC_TRACECode Tracing
0x28INT_VEC_LINE_1010Special instructions generated by ER_throw (0xA???)
0x2CINT_VEC_LINE_1111F-Line instructions (0xF???)
0x3CINT_VEC_UNINITIALIZED_INTUninitialized interrupt vector
0x60INT_VEC_SPURIOUS_INTSpurious interrupt
0x64AUTO_INT_1Main timer hardware interrupt running at approximately 350 Hz
0x68AUTO_INT_2
INT_VEC_KEY_PRESS
Key press (triggered periodically while key(s) other than 'ON' are held down; the rate depends both on battery strength and on which keys are being held down, and is usually in the ballpark of about 600 Hz)
0x6CAUTO_INT_3On most calculators, triggers once per second if enabled using a certain instruction
0x70AUTO_INT_4
INT_VEC_LINK
Link port activity
0x74AUTO_INT_5System timer running at approximately 18 Hz (see PRG_setRate, PRG_setStart)
0x78AUTO_INT_6
INT_VEC_ON_KEY_PRESS
'ON' key press
0x7CAUTO_INT_7
INT_VEC_STACK_OVERFLOW
Stack overflow (actually results in Protected Memory Violation)

All traps may be triggered manually using the TRAP assembler instruction.

AddressAssociated ConstantDefault Behavior
0x80TRAP_0(unknown)
0x84TRAP_1
INT_VEC_INT_MASK
Change interrupt mask (bits 8-10 of %sr) to %d0.w, output old mask in %d0.l
0x88TRAP_2
INT_VEC_MANUAL_RESET
Reset calculator
0x8CTRAP_3(unknown)
0x90TRAP_4
INT_VEC_OFF
Turn the calculator off and wait for 'ON' key press
0x94TRAP_5(unknown)
0x98TRAP_6(unknown)
0x9CTRAP_7(unknown)
0xA0TRAP_8(unknown)
0xA4TRAP_9Access to various system routines
0xA8TRAP_10
INT_VEC_SELF_TEST
Enter self test
0xACTRAP_11
INT_VEC_ARCHIVE
Print "Trap 11" and freeze
0xB0TRAP_12Put the processor in supervisor mode; return the previous value of the status register in %d0:w
0xB4TRAP_13Print "Trap 13" and freeze
0xB8TRAP_14Print "Trap 14" and freeze
0xBCTRAP_15
INT_VEC_ER_THROW
Print "ER_throw" and freeze

See DEFINE_INT_HANDLER for an example of usage.


See also: GetIntVec, IntVecs, DEFINE_INT_HANDLER