وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

FPU_Stack



FPU_Stack   ..



The FPU Instructions work with a stack of 8 registers: ST0 to ST7:


----------------------------  (TOS -Top Of  Stack-) ----------------------------------------

79                                         64                                                                                                     0

__| ____________________| ____________________________________________________    ST0 

__| ____________________| ____________________________________________________    ST1

__| ____________________| ____________________________________________________    ST2

__| ____________________| ____________________________________________________    ST3

__| ____________________| ____________________________________________________    ST4

__| ____________________| ____________________________________________________    ST5

__| ____________________| ____________________________________________________    ST6

__| ____________________| ____________________________________________________    ST7


Registers of the Floating Point Stack.



The Top of the Stack (TOS) is the ST0 Register. Each time you load a Number on the FPU Stack, with one of the FLD FILD Instructions, all the values in the FPU Stack are pushed one register downward and this Number is written in ST0.


The reverse way, each time you retrieve a Number from the FPU Stack, for example with FSTP FISTP Instructions, the ST0 Register Value is copied into the Memory destination, and all of the Stack Values are move one Register upward.


Important note: You can not load more than eight Values in the FPU. So, when starting a block of FPU Instructions, it is recommended to begin with an FINIT Instruction, in order to restore the FPU to its empty default state.



~~~~~~~