[futurebasic] Re: Assembly help

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1997 : Group Archive : Group : All Groups

From: wave@... (M Goodes)
Date: Fri, 21 Nov 1997 22:03:31 -0500
Sorry, I didn't read your original post as well as I should have.  This is
pretty wierd.  I can't understand everything in the header, but you might
want to try just changing the size of the variable osErr.  This shouldn't
make any difference, but what the heck, who knows...here's what you do.
1.  Change >`     SUBQ.W  #4,sp                    ;clear space for osErr
     to `  SUBQ.W  #2,sp
     or, even better, ` clr.w  -(sp)
2.  Change >`     MOVE.L  (sp)+,^osErr&           ;D0 = osErr
     to ` MOVE.W  (sp)+,^osErr%
3.  Change the rest of the osErr& variables to osErr% variables.

You also might double-check that you are passing the correct address of
your string, just in case data is being written to some other address.

A wild guess, I know, but hope it helps...


>M Goodes:
>
>I dont use an RTS statement. I think FB put it in there when it compiles
>the assembly function because the function returns to the function that
>calls it. I think that youre right about it not returning to the correct/valid
>address because it ses: Bus Error while fetching data from 0005 and 0007
>(which are odd addresses - illegal, right?) I jjust dont know if its s my
>assembly or what. Heres my code:
>                                      pascal ICError
>ICCFindPrefHandle(internetC
>onfigurationComponent inst, ConstStr255Param key, ICAttr *attr, Handle prefh)
>                                      FIVEWORDINLINE(0x2F3C, 12, 36,
>0x7000, 0xA8
>2A);
>(actually thats the C-header). Heres my assembly:
>LOCAL
>DIM osErr&
>LOCAL FN ICCFindPrefHandle (inst&, key&, ICAttrPtr&, prefh&)
>`     SUBQ.W  #4,sp                    ;clear space for osErr
>`     MOVE.L  ^inst&,-(sp)       ;place the component instance on stack
>`     MOVE.L  ^key&,-(sp)              ;move key pointer
>`     MOVE.L  ^ICAttrPtr&,-(sp)        ;move ICAttr&
>`     MOVE.L  ^prefh&,-(sp)            ;move valid handle on
>`     DC.W    $2F3C,$0012,$0036,$7000,$A82A
>`     MOVE.L  (sp)+,^osErr&           ;D0 = osErr
>END FN = osErr&
>
>I know that the OSErr should be a long int because its defined as such
>in the header file. Does anybody see a problem here? Its pretty wierd.
>
>Ryan
>--
>To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>

____________________
Use e-mail with integrity.
M Goodes (wave@...)