Questions tagged [x87]

x87 is the legacy 80bit floating point subset of the x86 instruction set. It's obsoleted by SSE/SSE2 for float/double, but is still useful for 80bit extended precision. The 32bit x86 ABI also returns FP results in an x87 register. See the tag wiki for a tutorial link.

See the wiki for links, including the most useful one: http://www.ray.masmcode.com/tutorial/index.html.

249 questions
-1
votes
1 answer

Comparing Signed and unsigned values in numeric processor

Hey guys i have my finals coming up ,currently studying assembly and i'm struggling with one thing that i cant really find an answer too. Lets say i have 2 Double Values x1=-0.5 ,x2=1.0 i want to compare x1 and x2, but sadly one of them is signed…
Soske
  • 541
  • 1
  • 4
  • 10
-1
votes
1 answer

How to use gnu gcc flag -mpc32, -mpc64 and -mpc80?

I got these GCC flags from the GNU GCC compiler Manual. But when I tried to use those flags (-mpc32, -mpc64 and -mpc80) I couldn't observe the behavior. So I need help on how to use these flags with a sample code. sample code I tried:…
-1
votes
1 answer

x8086 Assembly, pushing 0.0001 onto stack becomes 9.99999.. instead of 0.0001

I am trying to implement newtons algorithm for square roots. I have included the complete C program so you can see what i am trying to do. I am trying to write the C program included below in assembly. Right now i am just trying to correctly write…
Some_Dude
  • 309
  • 5
  • 21
-1
votes
1 answer

x87 floating point instructions into C code

I have this assignment, and x, y, and z are double type variables: fldl x fldl y fmulp st, st(1) fldl z faddp st, st (1) fstpl z Translating this into C, I got this: z+= x*y I am not sure about z tho? Did I translated it…
Anastasia Netz
  • 173
  • 2
  • 12
-1
votes
1 answer

ASM Floating-point unit giving wrong numbers

I am making a bigger program using Floating-point unitin ASM, but I am getting wrong numbers. I made a simple code, which is also giving false numbers. Anyone got idea why? What is wrong here? I am using ubuntu 32b. SYSEXIT = 1 .align 32 .data a:…
-2
votes
1 answer

Dividing floats in extended assembler

In my C program, I would like to do the following in extended assembler: Divide two floating point numbers (variables), 'numerator' by 'denominator', and put the result in another variable, 'result'. This is my guess of how it would look like, but…
LukesDiner
  • 145
  • 8
-2
votes
1 answer

Converting an inline-asm x87 fsqrt function from C++ to C for x86-64

I was looking at different methods to compute the square root, and one in particular (sqrt14 from here) caught my attention, unfortunately it was written in C++ (it only uses assembly), it's difficult for me to translate it back to C - if that's…
TheBigBadBoy
  • 611
  • 5
  • 14
-3
votes
2 answers

x87 double addition don't work

I defined an assembly function which takes three parameters (int, double, double) which should add two putted double value and return the result of this addition. And I don't know why the below code doesn't work: extern double ftaylor(unsigned int…
fingolfin
  • 77
  • 5
-4
votes
1 answer

Can anyone break down what this assembly code does?

The following code is some rudimentary calculation in an old racing game. Its models downforce, by checking the car's current speed. There is a downforce coefficient (which I traced at the third line down) which is multiplied somewhere by the car's…
1 2 3
16
17