Solved

ASM to Delphi

Posted on 2006-10-28
4
555 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 250 total points
ID: 17828458
I think System.Math.Tan() should be the .Net equivalent.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month7 days, 3 hours left to enroll

623 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