[futurebasic] Re: Inline Assembly - assem. newbie Question

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

From: Chris <behmc@...>
Date: Thu, 4 Dec 1997 01:14:33 -0500
>>Ok. I'm just getting in to Assembly, to do some OSA stuff. Basically,
>>before this I haven't written a lick of Assembly, and so I need some
>>answers. I have figured out how to call toolbox functions (eg: CALL SysBeep
>>() in assem. would be _SysBeep, and CALL Debugger () would be _Debugger,
>>right?). And this much I learned from the FB Ref. Manual. :)
>
>Well, first; get the Universal Headers(Pascal) file, convert it with Andy's
>Pascal converter, and see how it works; usually that's enough to get you
>going. (But I'm not much of an asm buff myself.)
>
>I believe things like _SysBeep, _Debugger, etc, have Hexadecimal
>Equivalents, meaning that _SysBeep really isn't part of asm itself, it's
>like a constant.
>
>For instance, _ParamText is really 0xA98B; some(if not all) assemblers
>should know these type of constants, at least for 68k/Mac compilers...
>
>I may be totally off, though. It's just the way I think it works.
>
>>Well, I figured that much out, but I don't see how to pass parameters with
>>the toolbox calls. Such as, in the toolbox call DebuggStr, it takes one
>>parameter, a string. How would I pass Debuggstr something like "FOOBAR"?
>>Would I MOVE "FOOBAR" into the a6, or a7, or what?
>
>You got me; as I said, play with the Universal Headers a bit; I'm sure
>there's some useful info there.

I may be totally off, but I believe you need to push the parameters you are
passing to a toolbox call (such as _Debugger) onto the stack _before_ you
make your call.  This being the case (as I think it is) you need to make
sure to push the parameters onto the stack in the correct order to be
popped off by the function.

*Chris