What happens when I push more than 8 values into the FPU stack?
Ex: I push 8 values into the stack, filling this way all ST(x) spaces. When I push one more value into ST(0), what happens to ST(7)? Will it simply be overwritten by ST(6)?
Posted on 2001-10-16 21:45:40 by eeprom
Yes, more or less. If you push 9 values then the 9th - 2nd pushed are stores from st(0) - st(7).

The very first value pushed is lost, I believe its actually overwritten by st(0)
Posted on 2001-10-17 12:59:20 by Eóin
Hi eeprom, e?in is right, the values will be overwritten. it is a kind of readdressing the 8 fpu-registers with changing each index to ((index + 1) modulo 8). This is done if a value is pushed onto the fpu-stack. If you pop the content of st0 then the turning will go the other way ...

In normal cpu-state the fpu doesn't care about this overrun, but due to some exception-behavior-flags in the cpu-state-registers it is possible to turn the fpu in a mode in which it will cause an exception if there is any overrun of fpu-regs (this means if the content of st7 is lost by pushing a new value onto the fpu-stack).

So take care of this if your asm-code is running within a hll-project which turns this feature on ...

Greetings, CALEB
Posted on 2001-10-17 18:53:00 by Caleb