?
Solved

ASM to Delphi

Posted on 2006-10-28
4
Medium Priority
?
560 Views
Last Modified: 2013-11-22
I neet to port this ASM function to Delphi because .Net does not support ASM...

Any help would be apprciated...

Thanks!


   function FTan (Angle: Extended): Extended;
     asm
            fld      [Angle]      
            ffree      st(7)      
            fptan                
            fstp      st(0)      
            fwait

     end;
0
Comment
Question by:PaulP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Expert Comment

by:tobjectpascal
ID: 17827753
Yes, another reason why i don't like .NET you can only use what they give you, it's not really that flexible at all.
0
 
LVL 28

Expert Comment

by:TName
ID: 17828162
Have you tried sinply using Tan() instead? (Presuming the Math library for .Net is similar to the Win32 one...)
Does Delphi for .Net itself use assembler? You might want to look at your Delphi version's tan function (there has to be one) and see if it's similar.

BTW, this is how tan() looks like in D7's Math.pas:

function Tan(const X: Extended): Extended;
asm
        FLD    X
        FPTAN
        FSTP   ST(0)      { FPTAN pushes 1.0 after result }
        FWAIT
end;

0
 
LVL 28

Expert Comment

by:TName
ID: 17828194
>this is how tan() looks like in D7's Math.pas
So the only differences are that here the angle value is passed as a const and that your function frees the last stack register before computing the tangent.
0
 
LVL 28

Accepted Solution

by:
TName earned 1000 total points
ID: 17828458
I think System.Math.Tan() should be the .Net equivalent.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question