Results 1 to 7 of 7

Thread: Comparing Floating Points

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Say I want to compare 2 floaring point numbers, I have a number in st(7) and a number in st(0), I want to compate st(7)with st(0) and pop st(0), then jump if st(0) was greater than st(7).

    So I should use fcomp, I've got that much, but then what, do I just use ja or is there a special thing I have to do?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I think it sets the comparison flag in the same way as cmp, so the normal jump commands can be used.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    again you're too late parksie, you're wrong as well.

    fcomp sets the FPU status word, which you can copy to ax using fstsw, then you have to use test or bt or something to check the relevent bits.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Ooops...

    Oh well - it's what I managed to extract from the rather minimal docs I have...anyway, you've got it sorted now, so that's okay.

    (notes down info for future reference) <-- see? learn something new every day
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    The Art Of Assembler has some pretty good info on it, so does intel, there's links to AoA all over this site so I won't bother looking it up. just in case you need to do some floating point stuff

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I found a really neat trick for learning how to do certain things with asm...

    Write it in C++, then turn full listings on in the project options. Out comes a load of asm code .
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I can't find that, I use the dissasembly window when it's debugging (run it and put a break point in, then right click on the code you want and hit go to dissasembly, and there's all your code.

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