Thanks!
I implemented a stack shadow function in the parser.
Does this look reasonable as a way of preserving the proper calculations?
var a;
a=(1+(2+(3+(4+(5+(6+(7+(8-9))))))));
;------Begin------;
_func:
push ebp
mov ebp,esp
finit
sub esp, 4
fld dword [_0]
fld dword [_1]
fld dword [_2]
fld dword [_3]
fld dword [_4]
fld dword [_5]
;overflow to stack
sub esp, 4
fld st(7)
fstp dword [ebp-8]
fld dword [_6]
;overflow to stack
sub esp, 4
fld st(7)
fstp dword [ebp-12]
fld dword [_7]
;overflow to stack
sub esp, 4
fld st(7)
fstp dword [ebp-16]
fld dword [_8]
fsubp
;restor from stack
fld dword [ebp-16]
fstp st(7)
add ebp, 4
faddp
;restor from stack
fld dword [ebp-12]
fstp st(7)
add ebp, 4
faddp
faddp
faddp
faddp
faddp
faddp
fstp dword [ebp-4] ;store in a
mov esp,ebp
pop ebp
ret
;------End------;
section "data"
_0:
dd 0x3F800000 ;-> 1.00000000
align 4
_1:
dd 0x40000000 ;-> 2.00000000
align 4
_2:
dd 0x40400000 ;-> 3.00000000
align 4
_3:
dd 0x40800000 ;-> 4.00000000
align 4
_4:
dd 0x40A00000 ;-> 5.00000000
align 4
_5:
dd 0x40C00000 ;-> 6.00000000
align 4
_6:
dd 0x40E00000 ;-> 7.00000000
align 4
_7:
dd 0x41000000 ;-> 8.00000000
align 4
_8:
dd 0x41100000 ;-> 9.00000000
align 4
Also, Does Oxygen have any built-in functionality for inspecting the fpu at runtime?
Thanks again!