# TRAP Instruction

The instruction TRAP pushes the program counter and the status register on the supervisor stack, switches to supervisor mode and the program counter is given a new value taken from one of the sixteen vectors, given by a four bit data value.
The instruction is used in applications to call a supervisor program (an OS for example) without knowing exactly where in the memory the OS is.
ADDRESS METHODS: N/A
DATA LENGTH: N/A
FLAGS: Unaffected
SYNTAX: TRAP #<vector>
The vector used by TRAP is stored at $80+4*vector (absolute address).

EXAMPLE CODE:

TRAP #15 EASy68K uses TRAP #15 for simulator control.