Floating Point Confuce

[b][red]This message was edited by zolkefli at 2003-10-18 4:14:56[/red][/b][hr]
When we assign value to ST(0) say using FLD , The old ST(0) will be push to ST(1) and ST(1) to ST(2) and so on. My question is: What happen to the value in ST(7). We lost it?

Thanks a lot
nothing nothing

• : When we assign value to ST(0) say using FLD , The old ST(0) will be push to ST(1) and ST(1) to ST(2) and so on. My question is: What happen to the value in ST(7). We lost it?
:
:
: Thanks a lot
: nothing nothing

If I understood it correctly, the situation seems as the following:

Imagine FPU stack as a circle. ST(0) means the FPU register, which is at the top of the stack.

ST(0) <- TOP OF THE STACK (TOS)
ST(1)
ST(2)
ST(3)
ST(4)
ST(5)
ST(6)
ST(7)

When processor performs FLD: 1. DEC TOS 2. ST(0) <- operand
What means DEC TOS? It means that all registers keep with no change, there is only shift in interpretation of ST(0), so old_ST(0) becomes ST(7) and old_ST(7) becomes ST(6) and so on. Imagine a circle...

I wonder if I am right here...

[blue]First of all - sorry for my bad english... but I'm learning...[/blue]