Hi,everybody!
I build a library of procedures.
Every procedure i put in separate hla file and have one hhf file where i put procedure @external declarations.
If in one of hla modules i set @basereg := esp its OK. Params are addressed by esp in this module.
But @parmoffset := 4 seems no effect in this case. All params are addressed as if @parmoffset := 8.
And only if i set @parmoffset := 4 in hhf file before procedure @external declaration it has effect.
But this manipulations seems a bit ugly to me.
And also i have to restore @parmoffset := 8 after declaration or this offset will be applied to further procedure declarations.
Can anyone explain where this declarations are legal and what effect they have in different places?
Posted on 2005-10-18 07:31:03 by Elohim Meth

Hi,everybody!
I build a library of procedures.
Every procedure i put in separate hla file and have one hhf file where i put procedure @external declarations.
If in one of hla modules i set @basereg := esp its OK. Params are addressed by esp in this module.
But @parmoffset := 4 seems no effect in this case. All params are addressed as if @parmoffset := 8.
And only if i set @parmoffset := 4 in hhf file before procedure @external declaration it has effect.

Yes. This is because the offsets for the parameters get set only once -- and because the external declaration is the first declaration, that's the value that HLA uses.


But this manipulations seems a bit ugly to me.

I agree, the whole concept is ugly. I'm not supporting that scheme in HLA v2.0. I'll try a different approach. Word to the wise, if you want your code to port to HLA v2.0 (whever it appears in the far future), I'd just use text equates for all such accesses.


And also i have to restore @parmoffset := 8 after declaration or this offset will be applied to further procedure declarations.

Also true. parmOffset is simply an internal HLA compiler variable that you get access to via the @parmOffset pseudo-variable.
The @parmOffset compile-time assignment is the *only* thing that changes this value.


Can anyone explain where this declarations are legal and what effect they have in different places?

Technically, they're legal everywhere. But they only take affect with the next procedure declaration and HLA only uses the offsets associated with the *first* declaration (e.g., external, forward, or standard) that it finds.
Cheers,
Randy Hyde
Posted on 2005-10-18 22:26:20 by rhyde
Thanks for your reply Randy!
So as you advised i will not use @parmoffset.
Text equations are enough for my purposes.
Posted on 2005-10-19 04:23:02 by Elohim Meth