68000 Microprocessor Antonakos Pdf 13
I've been revisiting Motorola 68000 programming lately. Admittedly, when I took the course I just did what was necessary to pass (and had a horrible professor)...but NOW I'm actually interested in the stuff. Anyway, looking through my old textbook The 68000 Microprocessor by James L. Antonakos, he uses the following code:
68000 microprocessor antonakos pdf 13
Is this just due to differences between the compilers? Or am I missing something bigger here? I understand that in the simulator TRAP #15 executes whatever task is in register D0 at the time, but are there different trap tasks per simulator, or is that standard across all 68000 processors?
The TRAP instruction just calls a routine that's pointed to by a longword somewhere in memory. That part of the behaviour is common to all 68000 CPUs. Where that longword points, and what the routine it points to does (and therefore how you pass it the data it needs and so on) depends on the particular system.
The 68000 provides 16 user traps (software interrupts/exceptions) but doesn't specify what they do. That is down to the system BIOS/OS, whether that be a simulator or Amiga, Atari ST etc. You can find a list of tasks performed by TRAP 15 in Easy68k at the bottom of this document