Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Absolute value : URGENT

aonksaonks Member Posts: 2
hey ... can someone please tell me the inline assembly code to find the absolute value of a double variable ??

it is very urgent ...

reply soon

Comments

  • aonksaonks Member Posts: 2
    : hey ... can someone please tell me the inline assembly code to find
    : the absolute value of a double variable ??
    :
    : it is very urgent ...
    :
    : reply soon
    :



    i'm using GCC in Cygwin
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : hey ... can someone please tell me the inline assembly code to find
    : : the absolute value of a double variable ??
    : :
    : : it is very urgent ...
    : :
    : : reply soon
    : :
    :
    :
    :
    : i'm using GCC in Cygwin
    :
    [color=Blue]Here is how it will look in Visual C:[/color]
    [code]
    double value = -482.93734;

    _asm lea edi, value
    _asm fld tbyte ptr [edi]
    _asm fabs
    _asm fstp tbyte ptr [edi]
    [/code]
    [color=Blue]And what's wrong with normal fabs() function from math.h?[/color]
  • ultranoultrano Member Posts: 2
    : hey ... can someone please tell me the inline assembly code to find
    : the absolute value of a double variable ??
    :
    : it is very urgent ...
    :
    : reply soon
    :

    You just have to clear bit 63...

    _asm and dword ptr[value+4],7FFFFFFFh



Sign In or Register to comment.