NASM Forum > Programming with NASM

Question about x87 FPU fsave and fstenv instructions

(1/2) > >>

ben321:
What is the difference between the fsave and fstenv instructions. The descriptions I've seen for these both seem to indicate that they dump the complete state of the FPU to a memory location. Can someone here explain the difference between these two instructions?

debs3759:
FSTENV stores the FPU operating environment (control word, status word, tag word, instruction
pointer, data pointer and last opcode) into memory. The memory area is 14 or 28 bytes long,
depending on the CPU mode at the time.

FSAVE saves the entire floating-point unit state, including all the information saved by FSTENV
plus the contents of all the registers, to a 94 or 108 byte area of memory
(depending on the CPU mode).

(copied from nasmdoc 0.98)

Frank Kotler:
Unless my memory fails me - quite possible = "fsave" saves the whole fpu state and "fstenv" saves only the environment...

(this is obsolete!)
http://home.myfairpoint.net/fbkotler/nasmdocc.html#section-A.4.97

If in doubt, why not try it?

Best,
Frank

ben321:

--- Quote from: debs3759 on October 08, 2022, 10:44:12 PM ---FSTENV stores the FPU operating environment (control word, status word, tag word, instruction
pointer, data pointer and last opcode) into memory. The memory area is 14 or 28 bytes long,
depending on the CPU mode at the time.

FSAVE saves the entire floating-point unit state, including all the information saved by FSTENV
plus the contents of all the registers, to a 94 or 108 byte area of memory
(depending on the CPU mode).

(copied from nasmdoc 0.98)

--- End quote ---

Is there documentation somewhere, that tells the memory layout of the FPU environment dump form the FSTENV instruction?

Frank Kotler:
Maybe?
https://www.plantation-productions.com/Webster/www.artofasm.com/DOS/ch14/CH14-5.html#HEADING5-95

Best,
Frank

Navigation

[0] Message Index

[#] Next page

Go to full version