Results 1 to 5 of 5

Thread: Math???

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Math???

    What do I need to INCLUDE in order to do things like Log(), Sqrt() and trig functions like Sin(), Tan() etc......
    I don't live here any more.

  2. #2
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: Math???

    Hmmmm I think I know what you mean ....
    To include math functions you'll need a maths library. (But I don't think this is appropriate.)
    You should go and read about FPU (Floating Point Unit) in your assembly book (I believe you got one right?) or read this pretty good tutorial By Raymond Filiatreault

    http://www.website.masmforum.com/tutorials/fptute/

    Its kinda confusing at first but it assembly is until it finally clicks. Trust me it won't take for ever to figure it out....though i thought so 6 months ago.

    Another way of doing this would be to use SSE, SSE2 or 3DNow!(But only works on AMDs). Unfortunately this is almost completely different from the FPU. These instructions allow you to do 4 multiplies/divides etc. in a single instruction(taking the time of 1 multiply/division etc. of the FPU).
    SSE, SSE2 is harder to learn for one major reason.....there are no tutorials.
    You have to read the intel manual :P.

    However learning MMX (MMX works only on integers) will give you some basic idea about SIMD. Fortunately I have found 1 tutorial other than the intel manuals. Rawhed's MMX tutorial (Appeared in Hugi 19)

    So the choice is yours....you'll have to look for a math's library / use FPU / use SSE/SSE2(SSE for single floating point while SSE2 for double)

    Cheers,
    Raedwulf

  3. #3

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Math???

    Actually, my book doesn't cover the FPU in detail with regard to performing things like trig or sqrt. It concentrates on virtually everything else though

    Thanks for that link, it looks useful.

    Cheers.
    I don't live here any more.

  4. #4
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: Math???

    No problem... if you get stuck i can help you out... It should just take practice though.

  5. #5
    Lively Member
    Join Date
    Nov 2005
    Posts
    68

    Re: Math???

    download the reference of your cpu (from intel's site for example). it's all there

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width