Assertions: Difference between revisions

Content added Content deleted
No edit summary
Line 17: Line 17:
assert(a == 42, ‘Error message’)</lang>
assert(a == 42, ‘Error message’)</lang>
=={{header|68000 Assembly}}==
=={{header|68000 Assembly}}==
The <code>TRAP</code> instruction is used for error handling. Execution jumps to a specified memory address stored in the "trap table."
The <code>TRAP</code> instruction is used for error handling. Execution jumps to a specified memory address stored in the "trap table." Depending on the hardware, the exception handling subroutine is either built into the kernel or is defined by the programmer.


<lang 68000devpac>CMP.L #42,D0
<lang 68000devpac>CMP.L #42,D0