[futurebasic] Re: [FB] Asm problem

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

From: Derek Smith <dereksmi@...>
Date: Thu, 17 Jun 1999 21:08:19 -1000
On Thu, 17 Jun 1999, Sylvain Guillemette wrote:

> I'm not familiar with asm, so i'd appreciate some help
> 
> 1) This is working:
> 
> LOCAL FN FontScript
>   ` MOVE.L #$82000000,-(SP)
>   ` DC.W    $A8B5
>   ` EXT.L    D0
> END FN
> 
> ScriptNum& = FN FontScript
> 
> 
> 2) This crash:
> 
>   ` MOVE.L #$82000000,-(SP)
>   ` DC.W    $A8B5
>   ` EXT.L    D0
> 
> ScriptNum& = REGISTER(D0)
> 
> How can i make #2 working ?

You mean you want to write the function inline instead of as a function
call?  I'm not sure what the glue code for FontScript should look like but
if it is a normal toolbox function, you may have to manually pop the value
off the stack into D0 yourself (assuming the toolbox call doesn't just
stuff its result there on its own).

You might try this:

` MOVE.L #$82000000,-(SP)
` DC.W    $A8B5
` MOVE.L  (SP)+,D0
` EXT.L    D0

If that doesn't work then I'd say there is no good reason why the code
shouldn't work without being wrapped in a function call.


-Derek Smith
-------------------------------------------------------------------------------
                "Getting my coworkers fired with FutureBasic"
                            FB 1, Coworkers 0
Homepage of FutureBasic resources and other pointless stuff at
http://www2.hawaii.edu/~dereksmi
------------------------------------------------------------------------------