Working with double-precision numbers in inline assembly (GCC, IA-32)
I'm just starting to learn assembly in my computer science class, and I have an assignment to round a floating-point value using a specified rounding mode. I've tried to implement this using fstcw , fldcw , and frndint . I modify the rounding control bits, round the number, and then restore the previous control bits (a requirement of the assignment). The current outstanding problem is that the instruction fld %1 seems to load the wrong value into the st(0) floating-point register (for example, if I call the function with a value of 2.6207, the number -1.9427(...)e-29 gets loaded into the