Greg Winton wrote:
> As best as I can tell, the SYS_TRAP macro expands as follows under
> CodeWarrior:
>
> void Foo () = {m68kTrapInstr+sysDispatchTrapNum, trapNum};
>
> This does not seem like standard 'C' syntax, is it a Metrowerks or
> Palm extension?
Yes it's a Metrowerks extension called "opcode inline" syntax. It's
documented in the compiler manual that comes with CW R4 (see "Mac OS and
C/C++") but seems to be missing from the R5 manual. (Hey Eric!!!)
> What is going on here? Does this imply some sort of a "jump"?
The declaration specifies the MC68K instruction bytes to be generated at
the call, instead of a standard call. For Palm OS API functions it's
always a TRAP instruction with the API ordinal number. This is
basically a subroutine call but by number instead of by address.
To see the generated code, use the "Disassemble" feature in the IDE.
That's a killer feature for learning this kind of stuff.
-slj-