At my university, we just met the FPU IA32 x87. But we were not told how to clear the FPU-Stack from the elements that were no longer required.
Imagine that we are doing a simple calculation, for example (5.6 * 2.4) + (3.9 * 10.3).
.data value1: .float 5.6 value2: .float 2.4 value3: .float 3.8 value4: .float 10.3 output: .string "The result is: %f\n" .text .global main main: fld value1
The problem is this: After you select the top FPU that contains the result of the calculation. How to free the FPU stack from the recently remaining top element that contains the result (5.6 * 2.4).
The only way I can imagine is to free a few more program stacks and push items from the FPU stack until all unnecessary items are removed.
Is there a way to directly manipulate the top pointer?
source share