[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Exec' (#aros)


Allocate a processor trap vector


Source position: exec.pas line 1265

function AllocTrap(

  TrapNum: LongInt





the desired trap number [0..15] or -1 for no preference.

Function result

The trap number allocated [0..15]. If no traps are available, this function returns -1.


Allocate a trap number from the current task's pool. These trap numbers are those associated with the 68000 TRAP type instructions. Either a particular number, or the next free number may be allocated.

If the trap is already in use (or no free traps are available) a -1 is returned.

This function only affects the currently running task.

Traps are sent to the trap handler pointed at by tc_TrapCode. Unless changed by user code, this points to a standard trap handler.

tc_TrapData is not used.


Traps may not be allocated or freed from exception handling code. You are not allowed to write to the exception table yourself.

See also



Free a processor trap

Documentation generated on: 2017-01-10