From Open Watcom
I've recently started to utilise pointers to functions. However I seem to have run into a brick wall...
Two of the functions that I've coded in assembly has the following parameter list: TRGB ARGB_Pack15(TARGB T); TRGB ARGB_Pack16(TARGB T);
By utilising the feature of passing arguments by means of registers, I've generated the following #pragmas:
- pragma aux ARGB_Pack15 modify exact  parm [ebx] value [eax];
- pragma aux ARGB_Pack16 modify exact  parm [ebx] value [eax];
A function pointer is to be utilised, to optimise the code, and point to one of the assembly functions. TRGB (*ARGB_Pack)(TARGB T);
Now, By default, the compiler will pass the first parameter in EAX (TARGB is just 4-bytes in size). However, I need the first parameter to be passed in EBX!
Is there a way for me to force the compiler to pass the arguments to the 'function-pointer' in EBX?
(When I call the assembly functions directly, the code works fine!) (When I call the 'function-pointer' the parameter is passed in EAX and not in EBX as I would like it to be!)
How can I use the #pragma aux to tell the compiler to pass the argument in EBX?
Many thanks in this regard!
This is not the right place for asking questions. You should go to the news groups at news://news.openwatcom.org/