» Home » Forums
  Register | Search | FAQ | Memberlist | Usergroups | Log in  

Reply to topic Using a global var with InlineASM
Using a global var with InlineASM
Jelmer


Joined: 16 May 2008
Posts: 1
Reply with quote
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?
View user's profileFind all posts by JelmerSend private message
 Reply to topic  

Powered by phpBB © phpBB Group. Design by phpBBStyles.com | Styles Database.