[futurebasic] [FB^3] Converting 68k toolbox to ppc toolbox

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1999 : Group Archive : Group : All Groups

From: "Dr. Steven J. Stratford" <sstratford@...>
Date: Sun, 19 Sep 1999 13:34:16 -0500
Followup on my own message---

<previous message>
Here's the old assembly code which works perfectly:

LOCAL FN YieldToAnyThread
   `     CLR.W     -(SP)
   `     DC.W      $42A7,$303C,$0205,$ABF2
   `     MOVE.W    (SP)+,D0
   `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr

Here's the new TOOLBOX code I wrote:

TOOLBOX FN YieldToAnyThread = WORD `0x42A7,0x303C,0x0205,0xABF2

This works in cpu68k mode but crashes in cpuPPC compiler mode.
</end previous message>

<new info>
The Apple Thread Manager docs state that "Threads must yield in the 
CPU addressing mode (24 or 32 bit) in which the application was 
launched." So I bet what's happening is that the TOOLBOX command 
switches to emulation mode from PPC mode and that's what's causing 
the crash.

So--looks like I need BEGINASSEM to generate PPC code. Can someone 
help convert my YieldToAnyThread function into PPC toolbox code?

Also, how about PPC assembly code snippets to do the same thing with

(1) toolbox fns that take 2- and 4-byte arguments
(2) toolbox fns that have VAR arguments
(3) toolbox fns that don't return a value

(I'm hoping that there _IS_ a pattern in the assembly code we can 
follow, just like with the 68k assembly code)
</new info>


Steven J. Stratford, InterNetyx.com
Supercharge your website!