Pregunta

How to set in control word of FPU bits in RC to 3?


answer (editor's note: don't post answers as part of the question, but for now it's here)

fstcw word ptr cw
or word ptr cw, 110000000000b
fldcw word ptr cw
¿Fue útil?

Solución

Looking at the fasm manual, you'd need to use fstcw to store the control word in a 16 bit memory location, modify the appropriate bits, and then use fldcw to load the modified control word.

The appropriate bits in this case are bits 10 and 11, and you want to set them both to 1, so or the memory location with 0x0C00 (3 << 10).

This will set the FPU to truncate all rounding and conversions, which hopefully is what you're trying to achieve.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top