Category:68000 Assembly: Difference between revisions

Content added Content deleted
Line 78: Line 78:


Certain traps have specific meanings as defined by the 68000 itself:
Certain traps have specific meanings as defined by the 68000 itself:
* Trap 4 occurs if the <code>ILLEGAL</code> command is executed. This is similar to <code>BRK</code> on [[6502 Assembly]]. If you're programming on a system or emulator with no built-in debugger, it's a handy way of seeing if execution is arriving at a certain point. If Trap 4 is pointed to a system reset or a hexdump routine you created. This (admittedly contrived) example will show the basic concept. If the <code>ILLEGAL</code> routine is executed, the programmer now knows that the code leading up to TestRoutine is bugged.
* Trap 4 occurs if the <code>ILLEGAL</code> command is executed. This is similar to <code>BRK</code> on [[6502 Assembly]]. If you're programming on a system or emulator with no built-in debugger, it's a handy way of seeing if execution is arriving at a certain point. If Trap 4 is pointed to a system reset or a hexdump routine you created, you'll know in an instant if the code before it is bugged. This (admittedly contrived) example will show the basic concept.
<lang 68000devpac>;trying to see if this routine works properly
<lang 68000devpac>;trying to see if this routine works properly
TestRoutine:
TestRoutine: