Category:68000 Assembly: Difference between revisions

m
Line 100:
; put your error handler here</lang>
 
WhatThis actuallyis happenscompletely isunnecessary, thatas the <code>DIVU</code> and <code>DIVS</code> use a trap to handle a divide by zero automatically. If the CPU would attempt to divide by zero, the processor automatically calls the relevant trap (Trap 5 in this case) if the divisor is zero. The return address and processor flags are saved, and execution jumps to the address specified in the trap list (a table of pre-defined memory addresses, stored at $000080 and going up. The standard 16 traps are stored here, with a 17th stored at $00001C.
 
Certain traps have specific meanings as defined by the 68000 itself:
1,489

edits