| Persistent Realities Forum Index » VB Fibre | The time now is Tue Sep 07, 2010 11:45 pm |
![]() |
Using a global var with InlineASM |
| Using a global var with InlineASM |
Jelmer
|
Hey,
I'm trying to to InlineASM to speed up my app. I have a sub called toX which is called a few thousand times per second (CAD-Like app). The function is as follows: Function toX(ByRef xIn As Double) As Double toX = (xIn - ggImageLeft) * mgZoom End Function My idea was to translate this to ASM, but I have no clue how to use my global vars ggImageLeft and mgZoom. The rest of the code should be something like this: Function asmToY(ByVal yIn As Double) As Double '#ASM_START ' mov eax, DWORD PTR _yIn$[esp+4] ' fld DWORD PTR _modCommon+128 ' fsubr QWORD PTR [eax] ' fmul DWORD PTR _modCommon+148 ' fstp QWORD PTR _asmToY$[esp+8] '#ASM_END End Function (This is copied from the log files that Inline ASM creates). Any thoughts on this? |
|||||||
|
